This is a variation of script from Chris and Shane that puts the SD version and OS version on the clipboard. You can then paste it into a forum message so readers know which SD and OS versions your report relates to. This new version accounts for having two different versions of SD installed (SD6 and SD7) which could be relevant.
This is what the output looks like:
–> Script Debugger 6.0.7 (6A217)
–> Script Debugger 7.0 (7A25)
–> Mac OS 10.11.6 (15G17023)
My version also changes the file name. I run it from the system menu, and that lets me quickly see the SD and OS versions without having to run the script.
This is what the file name looks like:
Copy SD 7.0 (7A25) - OS 10.11.6 (15G17023)
use scripting additions
use framework "Foundation"
use framework "AppKit"
------------------------------------------------------------------------------
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