0

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.

Skull
  • 157
  • 16
  • there might be timing issue when opening the Firefox that probably in the script are not taken into account. Try to add `tell application "Firefox" to activate` and `delay 1` into the AppleScript – Lino Aug 07 '18 at 09:57
  • what do you think? – Lino Aug 07 '18 at 10:17
  • This works as is for me without issue under macOS High Sierra, so it's probably a macOS Mojave specific issue. – user3439894 Aug 07 '18 at 12:31

0 Answers0