Join Scott Simpson for an in-depth discussion in this video Working with the command line in AppleScript, part of Up and Running with AppleScript.
- View Offline
- Exercise Files
…Of course in addition to using AppleScript at the command line,…you can also use AppleScript to talk to the command line environment.…Apple Script has a command called do shell script,…that passes information to the command line.…For example, I can do do shell script ls, and when I run that I get back the…result of the terminal command ls, which lists the files in the current directory.…Obviously that's a pretty basic example.…I'll take a minute and make an application that makes a…zipped tar file of a photo that gets dropped onto it.…
So I'll start with an open handler.…And a variable called, the folders.…Just like we did before and then drop that application.…Then I'll set up an iterator in case the user drops more than one item.…And then just be careful I'll include the try block.…So, if there's an error, I'll get a dialog…message with that error message instead of the program breaking.…And then since I'm working with folder…objects, I need to use the finder dictionary.…So I'll write tell application finder.…
- 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
Up and Running with Bash Scriptingwith Scott Simpson1h 25m 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.