We can identify each AppleScript runtime name by using simple AppleScript.
use AppleScript version "2.4"
use scripting additions
use framework "Foundation"
set procInfo to current application's NSProcessInfo's processInfo()
set aName to procInfo's processName() as string
display dialog aName
By running this code from BBEdit’s Script Menu gaves us “BBScriptRunnerXPCService”.
BBEdit seems to execute AppleScript by using other process in XPC service.
XPC service can not display such a notification UI.
So, BBEdit can not display notification messages from AppleScript.
You can display noftification dialog from BBEdit’s Script Menu by using other AppleScript Runtime.
do shell script "osascript -e 'display notification \"message from BBEdit\"'"
This AppleScript can display notification message because we changed AppleScript runtime program to /usr/bin/osascript.
Though we can select various way to execute AppleScript, /usr/bin/osascript will be the most simple way.
Thanks a lot! This will be very useful to figure out what’s going wrong in similar situations.
As mentioned previously I reached out to BBEdit support before I created this thread. As far as I know (i.e. what I read over the years) BBEdit is one of the most scriptable apps around. Makes me wonder why they didn’t know that BBEdit can not display notifications via AppleScript.
So now I’ll simply use …
… to display notifications via BBEdit’s script menu.