Join Scott Simpson for an in-depth discussion in this video Working with AppleScript at the command line, part of Learning AppleScript.
…One of the neat things about AppleScript is…that you can use it at the command line.…If you're into writing Bash scripts or…Python scripts or Ruby, or anything else that…can interact with the command line, you can…use AppleScript to control apps right from there.…From the Bash prompt, I can use the OSA script command, which…is a tool that Apple provides for working with the Open Scripting Architecture.…There's a few ways to run AppleScript with OSA script.…The first is by specifying one line of script at a time with the dash e option.…Here in the terminal window, I'll write osa script dash e, and then a line of…AppleScript, display dialog hi.…
You'll notice the extra slashes in there, which I need…on the quote marks to escape them or tell the command…line interpreter that that particular quote mark isn't for it to…interpret, but to pass it along to the osa script interpreter.…Escaping can get tricky pretty quickly, and there are a few other ways of…using AppleScript at the command line where you don't need to worry about it.…
- What is AppleScript?
- Using comments, variables, text, and numbers
- Working with files and folders
- Using conditionals and creating loops
- Building functions
- Controlling other programs with AppleScript
- Preventing and catching errors
- Distributing your AppleScript application
Skill Level Beginner
1. Exploring AppleScript
2. Using AppleScript with Applications
3. Your App in the Real World
4. Further Exploration
Folder actions2m 52s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.