Join Scott Simpson for an in-depth discussion in this video Using conditionals, part of Learning AppleScript.
…One of the usual tasks that a program needs to perform,…is checking whether things are equal or unequal to some condition.…I can compare items of the same class, using the equality operators.…For example, I can set a variable equal to the text hello.…And I can check if that text matches a value that I give it.…Here I'm setting var two, to the value of whether or not var one equals hello.…I will hit run and I see that it's true, if I change the second line to Hi…and run again, now it's false because Hello does…not equal to Hi, at least as a text string.…
If you use to other programming languages your spity sense…might be telling you there is an error here, but Applescript…uses the single equals character to test for quality not the…double equals sign, or triple equal sign that other languages use.…You can also take advantage of AppleScript's…natural language syntax with a couple other options.…For example, I can replace this part of…the variable declaration with, is equal to Hello.…If I run that, I get back True.…
- 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.