How to tell if a script is running in SD at runtime?

This may be an odd question. I have a script that I’m debugging that has Myriad Tables calls. I have a routine in the script that figure out if it’s running in Debug mode (assuming the script is in the front window when it starts running) and if it is it sends all the MT calls to an app that only displays tables. When SD is in Run mode it displays the tables itself.

The problem is when the script is saved as an applet I want it to know at runtime that it’s not running in SD and doesn’t need to know the run mode of SD’s front window.

Any suggestions?

→ Script Debugger 8.0.3 (8A49)
→ MacOS 11.6.2

You can easily know which runtime environment script runs on.

http://piyocast.com/as/archives/9004

This small script tell you the name of runtime environment.

An “applet” exists in various develop environment.

Script Editor’s applet : applet
Script Editor’s Cocoa AppleScript applet: CocoaApplet
Script Debugger’s applet (enhanced): FancyDroplet or FancyDropletFat
Automator’s applet: Application Stub

If you don’t want to use AppleScriptObjC, try something like this:

set doMyStuff to (name of current application ≠ "Script Debugger")

Thanks guys, two good solutions!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.