Want to highlight a helpful answer? Upvote!

Did someone help you, or did an answer or User Tip resolve your issue? Upvote by selecting the upvote arrow. Your feedback helps others! Learn more about when to upvote >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Applescript Interacting with a PList

I'de like to create a PList file when someone runs my application, and then change the variables in the file based on what buttons you choose. It would have to also work for various users as I'm distributing the app. Something like:


Display Dialog "Keep a log?" buttons {"No", "Yes"} default button 2 with title "Config"

if button returned of result is "Yes" then

-- Some command to change the variable to "Yes" in a PList file to remember for next use

else

-- Some command to change the variable to "No" in a PList file to remember for next use


end if

Is this possible? If so how? Thanks in advance. Really hoping you see this post, Red_Menace...

Posted on Apr 13, 2013 10:53 AM

Reply
Question marked as Best reply

Posted on Apr 13, 2013 11:37 AM

There are a few ways to use preferences in your application. If you are writing a Cocoa-AppleScript (regular or Xcode), you can use NSUserDefaults. For a regular AppleScript application, a property is persistent and is saved with the script (at least until the script is recompiled), and there is also the defaults command.

1 reply
Question marked as Best reply

Apr 13, 2013 11:37 AM in response to Apple_For_The_Win

There are a few ways to use preferences in your application. If you are writing a Cocoa-AppleScript (regular or Xcode), you can use NSUserDefaults. For a regular AppleScript application, a property is persistent and is saved with the script (at least until the script is recompiled), and there is also the defaults command.

Applescript Interacting with a PList

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.