Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Feb 25, 2013, 05:03 AM   #1
NecroDayz
macrumors newbie
 
Join Date: Feb 2013
Save System in AppleScript

Currently working on a text based AppleScript game but how would I go about making a save system?
NecroDayz is offline   0 Reply With Quote
Old Feb 25, 2013, 12:17 PM   #2
Red Menace
macrumors regular
 
Join Date: May 2011
Location: Littleton, Colorado, USA
If this is a regular AppleScript application you can store data in properties or use a preferences .plist file via defaults or the Property List Suite from System Events. For an Xcode or Cocoa-AppleScript application there is NSUserDefaults.
__________________
MacBook Pro / OS X Mavericks (10.9.2) / Xcode 5.1 / [and various (much) older stuff keeping dust off the shelves]
Red Menace is offline   0 Reply With Quote
Old Feb 25, 2013, 03:59 PM   #3
Gugulino
macrumors member
 
Join Date: Dec 2008
Location: Switzerland
Have a look at NSSavePanel.
__________________
MacBook Pro Core 2 Duo, Mac Mini 2011, iPhone 4, My website
Gugulino is offline   0 Reply With Quote
Old Feb 25, 2013, 05:58 PM   #4
NecroDayz
Thread Starter
macrumors newbie
 
Join Date: Feb 2013
Thanks for the help I appreciate it.
NecroDayz is offline   0 Reply With Quote
Old Feb 25, 2013, 06:01 PM   #5
ytk
macrumors regular
 
Join Date: Jul 2010
Quote:
Originally Posted by NecroDayz View Post
Currently working on a text based AppleScript game
That's about the insanest thing I've heard all week. Granted, it's only Monday, but still.
ytk is offline   0 Reply With Quote
Old Feb 26, 2013, 02:30 AM   #6
NecroDayz
Thread Starter
macrumors newbie
 
Join Date: Feb 2013
Ya it's pretty easy/hard at times due to it being pseudocode and it's just plain vanilla AppleScript however using .plist files how would I save/load variables
NecroDayz is offline   0 Reply With Quote
Old Feb 26, 2013, 08:34 AM   #7
Gugulino
macrumors member
 
Join Date: Dec 2008
Location: Switzerland
Ah, I thought you want to save a file such a text file.

You have to say "do shell script" and then something like that: defaults write com.apple.Finder AppleShowAllFiles NO

Instead of NO you can use your variable and instead of com.apple.Finder you use the name of your .plist file.

The .plist file has to be in the following directory: ~/Library/Preferences/.

I hope this helps!
__________________
MacBook Pro Core 2 Duo, Mac Mini 2011, iPhone 4, My website

Last edited by Gugulino; Feb 26, 2013 at 08:45 AM.
Gugulino is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting 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

Forum Jump


All times are GMT -5. The time now is 11:10 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC