Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Save user-defaults (first post)



Hi,

You have to set up initial values first (as far as I know), so your
tell user defaults
make new default entry at end of default entries with properties {name:"ipnumber", contents:ipnumb}
register
end tell
should go to an "awake from nib" or "will finish launching"
The "on should quit after last window closed theObject" should contain
tell user defaults
set contents of default entry "ipnumber" to ipnumb
end tell

Hope this helps

Andreas


Andreas Kiel

Spherico
Nelkenstr. 25
D-76185 Karlsruhe
Tel.: +49 (0)721 183 9753
eFax: +1 650 897 8094
eMail: email@hidden
On 30.03.2005, at 18:23, Kirk Pitts wrote:

Hello and thanks ahead of time to anyone who can help.
I have been playing with applescript for years but only recently tried Applescript studio.
I have a simple application made that will backup files from the desktop and documents folder to a folder on the users 10.3 server users folder.

They have to enter the ip address and username and password in a text field on the window.
I would like for the ip address and username to be saved and remain when they launch the program again.

I've looked at the Archive Maker example and can't seem to move the concepts from it to my program.

Does someone have a very basic example that will store the text entered in the text fields on subsequent uses of the program.

Any help appreciated.

I am using only one script in the application with simple variable names like ipnumb, userpw, and usern

on should quit after last window closed theObject
tell user defaults
make new default entry at end of default entries with properties {name:"ipnumber", contents:ipnumb}
register
end tell
quit
end should quit after last window closed

on opened theObject
tell user defaults
set ipnumb to contents of default entry "ipnumber"
end tell
end opened
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-studio mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-studio/email@hidden

This email sent to email@hidden

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-studio mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-studio/email@hidden

This email sent to email@hidden

References: 
 >Save user-defaults (first post) (From: Kirk Pitts <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.