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.4) / Xcode 5.1.1 / RubyMotion FTW
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

Similar Threads
thread Thread Starter Forum Replies Last Post
Hide OSX System Preferences in Applescript for toggling ignore trackpad in Mavericks? mactp Mac Programming 9 Mar 16, 2014 06:03 PM
AppleScript: How do I save multiple Excel sheets to one pdf using Applescript sbtaylor1 Mac Programming 0 Oct 28, 2013 11:38 PM
AppleScript: How do I save multiple Excel sheets to one pdf using Applescript sbtaylor1 Mac Applications and Mac App Store 0 Oct 28, 2013 11:32 PM
Applescript how to save to PC on network redwgaontoy Mac Programming 6 Jun 11, 2013 05:32 AM
Using Automator to create a system-wide keyboard shortcut to run an AppleScript Let's Sekuhara! Mac Programming 2 Jun 13, 2012 11:22 PM

Forum Jump

All times are GMT -5. The time now is 03:41 AM.

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

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