Why is preferences file name called com.apple.ASApplication.plist

Here is code i have to write out and read in stored data sources (i found this code here… thanks to whomever posted it.)

It works, however, the place it saves to is: “~/Library/preferences/com.apple.ASApplication.plist”

My application is named DLib4Amazon.app

How do i get this preference to save in it’s own pref file and not that of Applescript Studio. Doesn’t other scripts i write then attempt to write to the same pref file? (also I WOULD MUCH RATHER keep the data inside the package for ease of portability)

Also, one more (possibly) stupid question. I write the applescript app in the AS Studio environment. If i want to move the app to another computer, do i just copy “~/DLib4Amazon/build/Debug/DLib4Amazon” to another location? (or have i simpy set up XCode’s prefs wrong) This is seems counter intuitive to me.

TIA

Jann


on read_prefs()
	make new default entry at end of default entries of user defaults with properties {name:"storedAmazonDataSource", contents:{}}
	make new default entry at end of default entries of user defaults with properties {name:"storedMailingLogDataSource", contents:{}}
	
	set AmazonDataSource_stored to contents of default entry "storedAmazonDataSource" of user defaults
	set MailingLogDataSource_stored to contents of default entry "storedMailingLogDataSource" of user defaults
end read_prefs

on write_prefs()
	if AmazonDataSource is not "" then
		set contents of default entry "storedAmazonDataSource" of user defaults to (contents of every data cell of every data row of AmazonDataSource)
	end if
	if MailingLogDataSource is not "" then
		set contents of default entry "storedMailingLogDataSource" of user defaults to (contents of every data cell of every data row of MailingLogDataSource)
	end if
	
end write_prefs

The bundle identifier is stored in the application’s Info.plist file as a key called CFBundleIdentifier.

This page of the Xcode manual will show you where you can change that without editing Info.plist directly.

What do you mean by “move the app”? If you want to move the project, copy the entire project folder. If you want to put the built app on another computer–say, for testing–you should run the Release build configuration and copy that app to the other computer instead.

[Edit: Changed “build phase” to “build configuration”.]

ummm…dont’ please think i am stupid, however, “Release Phase”?

I was told the to go under target, click build, drop down to release and then click the BUILD button.

Is that it?

Jann

Yep, that’s the Release build configuration folder.

Look inside your build folder for a folder called “Release”. There should be an app in there.

[Edit: Changed “build phase” to “build configuration”.]

All i have is a Debug and a DLib4Amazon.build folder.

~/DLib4Amazon/build/Debug
~/DLib4Amazon/build/DLib4Amaozn.build

Looks like something is awry.

Jann

Did you click “Build” after changing to “Release”? You will need to build the app after changing the build configuration.

(Apologies, I kept saying “build phase” when I meant “build configuration”. It’s been a long night. I’m editing my posts to reflect the more accurate nomenclature.)

Yes i did click build.

I got the app using the new DLIB4Amazon.plist pref file now, thank you…

What i still don’t have is a release folder.

hrumph.

I am assuming i can just take the app from the aforementioned build folder, right?

Jann

You probably won’t be able to run a Debug config app properly when you move it from that folder to the other computer.

Clean your project (“Clean” under the “Build” menu), choose the Release configuration again, and build. See if you get a Release folder after that.

nope.

:frowning:

Hi,

I just had a recent post about this probem while trying to compile my app as Universal Binary.

My Xcode 2.2 did not have the Release build option and probably yours too. Querty Denzel said that Release is the same as Deployment so that’s what I used and it compiled alright as universal binary. So try using Deployment as your “Release” build option.

BTW, Debug is same as Development. I now have Release and Debug created in my Build Config by changing the corresponding names accordingly.

Good luck.

archseed :slight_smile:

Model: iBook G3
AppleScript: 1.10.3
Browser: Camino 1.0
Operating System: Mac OS X (10.4)

See also: Why my Xcode app doesn’t work when run in a different machine?

YEAH! Got the “Release directory” (don’t know if it changed anything) by going to Project->Set Active Build Configuration->Release

thx all!

Jann