Getting version info broken?

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

Well this is odd. If I note out the SD7 lines it still fails, but if I note out these lines for SD6 it works. Whats up with that?

–set appID to “com.latenightsw.ScriptDebugger6”
–set the end of appVersions to GetAppInfo(appID, shortAppName)

–> Script Debugger 7.0 (7A28)
–> Mac OS 10.11.6 (15G19009)

The error is telling you the system doesn’t know of an app with that bundle ID — the fact that it goes away when you comment out the v6 stuff says it’s having the issue with v6. Have you moved version 6 out of the /Applications folder?

I didn’t think I’d moved version 6, but It’s not there anymore, replaced by a copy of SD7.

I had created a SD7 folder in the Applications folder for testing, I must have dropped the latest in the wrong folder.

My mistake.

So I need to reinstall version 6, which build should I use that is not expired?

6A220 is the latest.