A few questions about AppleScript (that I’m annoyed about)
I have a couple of questions below about the programming language AppleScript.
The first question: Why is my AppleScript not working? (When answering, please put "[The number of the question goes here] [Answer goes here.]" I am trying to learn AppleScript, and I have tried making the following script recently, but it shows an error.
[AppleScript]
set theApp to (choose from list {"Safari", "Chrome", "Scripts", "App store", "Mail", "Facetime", "Messages", "Notes"} with prompt "Choose an app to open" with title "Some applications to open")
tell application theApp
activate
display dialog "hello"
end tell
[AppleScript]
And here is the error:
It is very annoying, and I want to know what's wrong.
The second question: What does "ignoring" mean in AppleScript?
The third and final question: I have looked at AppleScript's examples, and I would like to know why this code WORKS.
try
--insert some actions under here
display dialog "hello"
on error the error_message number the error_number
set the error_text to "Error: " & the error_number & ". " & the error_message
display dialog the error_text buttons {"OK"} default button 1
return the error_text
end try
Assuming the user clicks "Cancel," it will display the error "Error: -128. User canceled." It seems it is just making variables out of nowhere according to how it compiles. And it still manages to work without saying " /"error_message/" is not defined.
iMac 21.5″, macOS 10.15