Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Using AppleScript to write to an existing property list file?

Using AppleScript to write to an existing property list file?
Thread Tools
Fresh-Faced Recruit
Join Date: Jul 2007
Status: Offline
Reply With Quote
Jul 12, 2007, 09:42 AM
 
I'd like to create an install that updates an application.

I think I can work out how to install the necessary files using PackageManager but I'd also like to update an existing .plist file.

Would I update the property list file using AppleScript and run the script during the installation? If so can somebody please point me in the right direction as I've never used AppleScript.

Thanks very much.
     
Professional Poster
Join Date: Oct 1999
Location: :ИOITAↃO⅃
Status: Offline
Reply With Quote
Jul 12, 2007, 09:38 PM
 
This has several tips on accessing plists (the login items plist in particular) programatically:
Adding Items to Login Items From the CLI | Mac Geekery
     
Mac Elite
Join Date: Oct 1999
Location: San Jose, Ca
Status: Offline
Reply With Quote
Jul 15, 2007, 12:38 PM
 
AppleScript is really not a good tool for this. Rather you should look into:

1) Perl with the Obj-C bridge (takes a bit of getting used to if you don't know Cocoa)
2) The command line program 'defaults' ('man defaults' for more informatino)
3) 'plistbuddy' a command line program that Apple uses to do this sort of work in all of their installers. You can find a whole bunch of copies scattered in amonst /Library/Receipts/ (burried in the installers)
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:30 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2