I have 2 scripts 1st is bash and 2nd is AppleScript on my macOS 10.14 mojave. I am calling AppleScript from Bash and getting error. If I run AppleScript directly it will run without any issue.
If I run bash script to execute AppleScript I will get dialog "ERROR: Unable to find application identifier."
If I run AppleScript in Script Editor it will show correct (org.mozilla.firefox) application identifier with dialog.
Why its not showing application identifier when I run bash script to execute AppleScript.
Bash script :
#!/bin/bash
/usr/bin/osascript /Users/mymac/Desktop/tst.scpt
AppleScript :
property IDI : "NOTSET"
try
set IDI to bundle identifier of (info for (path to application "Firefox"))
display dialog " Identifier is " with title "Test" buttons {"Exit"} default answer IDI
end try
if IDI is "NOTSET" then
display dialog "ERROR: Unable to find application identifier." with title "Test" buttons {"Exit"}
return
end if
I cant put both script into one need them separately in scripts.