Below is the script I’ve been using with SD7 since the first version to put the app and system info in the clipboard. I just updated to 28, and this line tripped an error:
set appBundle to current application’s NSBundle’s bundleWithURL:appNSURL
*** -[NSBundle initWithURL:]: nil URL argument
use scripting additions
use framework "Foundation"
use framework "AppKit"
------------------------------------------------------------------------------
-->Script Debugger 6.0.4 (6A198) on Mac OS 10.10.4 (14E46)
set appVersions to {}
set shortAppName to "SD"
set appID to "com.latenightsw.ScriptDebugger7"
set the end of appVersions to GetAppInfo(appID, shortAppName)
set appID to "com.latenightsw.ScriptDebugger6"
set the end of appVersions to GetAppInfo(appID, shortAppName)
set sysVer to (current application's NSProcessInfo's processInfo()'s operatingSystemVersionString())
set sysVer to (sysVer's stringByReplacingOccurrencesOfString:("Version") withString:"")
set sysVer to (sysVer's stringByReplacingOccurrencesOfString:("Build ") withString:"") as text
set appInfo to {}
set infoString to {}
repeat with thisAppInfo in appVersions
set {fullAppName, appVer, appBundleVer} to thisAppInfo
set the end of appInfo to {fullAppName, appVer, appBundleVer}
set the end of infoString to "--> " & fullAppName & space & appVer & " (" & appBundleVer & ")"
-->Script Debugger 6.0.4 (6A198) on Mac OS 10.11.6 (15G1217)
end repeat
set the end of infoString to "--> Mac OS" & sysVer
set AppleScript's text item delimiters to {return}
set infoString to infoString as text
set the clipboard to infoString
set {appName, appVer, appBundleVer} to item 1 of appInfo
set fileNameFormat to {"Copy SD ", "version on", " OSX ", "version"}
set infoString to shortAppName & space & appVer & " (" & appBundleVer & ") - OS " & sysVer
-->SD 6.0.4 (6A198) on Mac OS 10.11.6 (15G1217)
set newFileName to "Copy " & infoString
set thisScript to path to me as alias
--Unnote next line and run script to set script name back to default
--set newFileName to fileNameFormat as text
tell application "Finder"
set oldFileName to the name of thisScript
if "Unsaved Script Debugger Document" is in oldFileName then return
if "Untitled" is in oldFileName then return
set nameExt to the name extension of thisScript
set newFileName to newFileName & "." & nameExt
if oldFileName is not newFileName then set the name of thisScript to newFileName
end tell
return the clipboard
--> Script Debugger 6.0.7 (6A217)
--> Script Debugger 7.0 (7A25)
--> Mac OS 10.11.6 (15G17023)
on GetAppInfo(appID, shortAppName)
set appNSURL to current application's NSWorkspace's sharedWorkspace()'s URLForApplicationWithBundleIdentifier:appID
set appBundle to current application's NSBundle's bundleWithURL:appNSURL
set fullAppName to (appBundle's infoDictionary()'s objectForKey:"CFBundleName") as text
set appVer to (appBundle's infoDictionary()'s objectForKey:"CFBundleShortVersionString") as text
set appBundleVer to (appBundle's infoDictionary()'s objectForKey:"CFBundleVersion") as text
set appInfoString to {fullAppName, appVer, appBundleVer}
return appInfoString
end GetAppInfo