Somewhat aggresive script

blackoutspy

Registered
I've been tryin to make a apple script that essencialy remebers window positions and stores them in variables. I dont have the coding knowhow quite yet, so i was hopeing you guys could help. What im looking to do is when the script is executed to have it bring up a window asking what windows positions i want remeberd. So this requres the script window to know what is open. I dont know if that would be possible with apple scripts, but then again thats where you genious's comin:p In the end i want to be able to use this script to launch all my programs i need for graphic dev and have them in the right area. Anyhelp will be much appreciated.
 
Well, you don't exactly have variables in Apple Script, but you can certainly tell certain applications to launch certain files, and tell them to position it at such-and-such with such-and-such size. Use the Record option and see if it does what you want: open a file, move and size it, repeat as necessary. If it doesn't record a certain programs actions, then tough luck. But it will at least launch whatever you want launched, simultaneously.

Naturally, put this script in your Startup Items. I have a script that positions all the icons on my desktop precisely where I want them and makes sure the main HD window is set to the proper size and location. It doesn't really ask what you want, you hard program the settings you desire straight into the script.
 
hmmm im wondering if i have a older version maybe, because when i run a recordable app, it registers that just fine, and quiting it, but it doesnt record resizing and possition, and ideas on why?
 
Under Mac OS X I've never been able to use the Record option with the Finder, but the stuff recorded in Mac OS 9 will play back correctly in Mac OS X.

I actually have some AppleScripts that are called by my freeware program "XFolderSets" which is a REALbasic program. The scripts are:

ActivateFinder
GetFinderWindowList
ZoomFinderWindow
OpenFinderWindow
GetFinderWindowBounds
CloseFinderWindow
SizeFinderWindow
MoveFinderWindow

They are tailored for inclusion in REALbasic but can easily be adapted to pure AppleScript usage. Send me your email address in a private message and I'll email them to you.

AppleScripts, by the way, have what are called "persistent variables." If you change the value of a persistent variable it is saved into the script's file, and next time you invoke the script the value is just where you left it. It's been awhile since I used such variables, but they're a very commonly used feature, and you get them for free. (I believe anything you declare outside of a "tell" block is essentially persistent, but don't quote me on that.)

Of course AppleScript also allows you to create files and store information in them, so you can use such a scheme in place of persistent variables.
 
Spy: See if you can actually set those attributes of your windows. Write a short script that will set a certain window to position 50, 50 and size 100, 300. If it works, find a way to determine the coordinates of the pixels on your screen, and manually set your windows where you want them and put the coordinates into Applescript.

I think, due to the differences in the way OS 9 and OS X handle windows, X has a problem recording window actions that 9 does not.
 
Back
Top