Shane and Mark,
I made a change to this post on 1/19/2018 in the second to the last paragraph.
Before
I quit the two background.apps and reran the same test I had done using SD. This time the script ran with no errors.
After
I quit the two background.apps and reran the same test I had done using SD. This time the script ran in ScriptDebugger with no errors.
The files background.scpt, foreground.scpt, background2:background.app, and background1:background.app were created on a Mac running El Capitan and the scripts were written and run in Script Editor. The actual test was run under Mac OS X Sierra.
The script called “background” was exported in “Script Editor” to create two Applets called background, one file in each of the 2 folders. This means the 2 new applets should be identical. The background.scpt in the top level of the folder hierarchy was not used during the test. Each of the scripts were put into different folders and the following structure was created in Finder:
- background.scpt
- foreground.scpt
- background 2 folder
-
- background.app
- background 1 folder
-
- background.app
foreground.scpt contained the following script
use scripting additions
tell application "System Events"
application file of every process whose name = "background"
end tell
The test consisted of launching background.app in the folders “background 2” and “background 1” on a Mac running “El Capitan.” Then the foreground.scpt was run under “El Capitan” using “Script Editor.” This ran successfully.
The scripts and applets were then zipped and sent to a Mac running “Sierra”. Then “foreground.scpt” was run under Sierra using “Script Debugger” and a problem occurred. An internal error dialog came up in SD, the “Details” button was clicked and the text was copied, the crash button was clicked, a Mac OS crash report dialog came up, then the SD crash information was copied. I put all the reports into a zip archive called “Crash related files.zip”
Error reports
- Details button.txt - Contains the text displayed after the “Show Details” button was clicked in the internal error dialog.
- OSX crash.txt - Contains the OS X crash report from the error that was generated.
- ScriptDebugger crash.txt - Contains the ScriptDebugger crash report from the error that was generated.
I ran the same script in “Script Editor” in the same way I ran it when using SD and it worked without a problem. It returned the following output:
returned {alias “1A795D23-27DA-4E87-B29B-B2A76CDB87C4:d:background.app:” of application “System Events”, alias “BF169D0F-FE7F-4BDA-9C86-C35F17E32994:d:background.app:” of application “System Events”}
I quit the two background.apps and reran the same test I had done using SD. This time the script ran in ScriptDebugger with no errors.
Part of the reason for trying this type of test was the fact I noticed a while ago that when I tried to differentiate between two different running Applets using AppleScript that had the same name the script could not differentiate between the applets. I thought it was a problem related to AppleScript. But I discovered today that “Script Editor” could differentiate between the applets. So this appears to be a problem specific to “ScriptDebugger.” SD’s ability to deal with Applets that have the same name has not worked for a while. For some reason I decided it was an AppleScript problem.
Crash related files.zip (249.5 KB)