AppleScript & Numbers error - The file format is invalid.
Here is a simple AppleScript to open a file:
set FileName to choose file of type "numbers" with prompt "Open File"
tell application "Numbers"
set DocName to open FileName
activate
end tell
It works.
But I don't need the interaction, I'd prefer to just set FileName to a fixed string, like this:
set FileName to "Source.numbers"
tell application "Numbers"
set DocName to open FileName
activate
end tell
But at runtime I get this error:
Seems I need to apply (of type "numbers") to FileName somehow but I can't figure it out.
Any ideas?
MacBook Pro (2017 – 2020)