Join Scott Simpson for an in-depth discussion in this video Making a droplet application to drag files onto, part of Learning AppleScript.
…Of course it's not always realistic to hard code paths into an application.…Especially if it's one you want to share with other people.…I want to make a few changes to this application to make it more portable.…In a little bit, I'm going to change some of the code to let…it accept files that are dropped onto it, wherever they live on the hard drive.…But first, let's take a look at the mechanics of how it works.…The first step in this process is to handle dropped files.…For that, I'll use a function, on open.…This function triggers when the application opens.…I can add a variable after the function name at the top.…
In this case, I'll use theFiles.…This variable, theFiles, is a list, so I can treat it like any other list.…I can cast it as a string just to make sure that it's giving me what I expect.…I'll display an alert with the files listed as a string.…I'll export this application,…and I'll call it TestApp.…And there it is on my desk top.…For a little bit of variety, I'll use some pictures of oranges.…
- 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.