New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Development and Darwin Discussion and questions about development for Mac OS X.

save container variable to file in applescript?


Post Reply New Thread Subscribe

 
Thread Tools
psychodork

 
psychodork's Avatar
 
Member Since: Aug 28, 2008
Posts: 42
psychodork is on a distinguished road
Mac Specs: Black MB - 2.4 GHz Intel Core 2 Duo - 4 GB DDR2 SDRAM - OSX 10.5.8

psychodork is offline
I'm a noob trying to write my second script, and I'm having trouble with this one, seemingly simple bit. I need to save a list, so it can be accessed when the script runs again, but I can't get it to work.

The script checks for a certain file. If the file doesn't exist, it gets the bounds of the active window, creates the file and saves the bounds to it. If the file does exist it's supposed to use the bounds I saved to set the bounds of the active window, and then it deletes the file so it can do the same thing again.

This is how I'm writing to the file:

set sizefile to open for access file sizefilepath with write permission
write orig to sizefile
close access sizefile

When I save it to a text file, instead of something like {94, 24, 815, 785} I get "list long^long long /long." If I tell it to write as a list, I get the same. If I tell it to write as a string, I get an error. I tried using "quoted form of" but that gives me an error too. Then I tried writing each item individually as an integer, but instead of numbers I get letters and special characters...I tried about a thousand more things, but I have no idea what I'm doing.

This is how I'm reading the file:

set orig to (read file sizefilepath)
do shell script "rm " & quoted form of sizefileposix

tell application frontapp
set bounds of window 1 to orig
end tell

It's getting frustrating....help please?
QUOTE Thanks

Post Reply New Thread Subscribe


« Darwine or Crossover? | Sending messages to other object's instances? »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
My PowerMac G5 is acting screwy! aedolch OS X - Operating System 5 08-01-2008 06:12 PM
What are the steps to save a Publisher file as a PDF? rcronin OS X - Apps and Games 6 01-03-2008 11:07 PM
Is it possible to save a file made in Pages as HTM? mLeroux OS X - Apps and Games 3 01-02-2008 05:17 AM
Can you guys open this site? Desolate One OS X - Apps and Games 13 04-29-2005 01:23 PM
JPEG file download via PHP on Mac(IE) irobot Web Design and Hosting 1 03-09-2005 09:40 PM

All times are GMT -4. The time now is 03:07 AM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?