NSUserDefaults's / Bundle ID

Is there a way to force a script bundle name to a name other then the script bundle name?

I tried this:


set theID to "com.mycompanyname.TestName"
set theDefaults to current application's NSUserDefaults's alloc()'s initWithSuiteName:theID

It does not work, I get error:

Found the answer. Posting for anyone else with this question…


set plistPath to "somepath:some.plist" --- point to any plist file
set theData to current application's NSData's dataWithContentsOfFile:(POSIX path of plistPath)
set infoDict to current application's NSPropertyListSerialization's propertyListWithData:theData options:0 format:(missing value) |error|:(missing value)
set theID to infoDict's objectForKey:"CFBundleIdentifier"
set theDefaults to current application's NSUserDefaults's alloc()'s initWithSuiteName:theID