image
image

Go Back   macosx.com > Design, Media, Programming & Scripting > Software Programming & Web Scripting

Reply
 
Thread Tools
  #1  
Old August 13th, 2003, 10:13 PM
Registered User
 
Join Date: Jun 2003
Location: oregon
Posts: 145
Thanks: 0
Thanked 0 Times in 0 Posts
blackoutspy is on a distinguished road
Somewhat aggresive script

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.
Reply With Quote
  #2  
Old August 14th, 2003, 03:44 AM
Arden's Avatar
Don't drink and derive.
 
Join Date: Dec 2002
Location: San Francisco
Posts: 7,743
Thanks: 0
Thanked 0 Times in 0 Posts
Arden is on a distinguished road
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.
__________________
System:
2.5 GHz MacBook Pro Core 2 Duo, 4 GB RAM, 200 GB hard drive, runs 10.5.4
1.6 GHz iMac G5, 1.5 GB RAM, 250 GB hard drive, runs 10.4.11
iPhone, 4 GB, OS X 2.0.2
Reply With Quote
  #3  
Old August 14th, 2003, 03:09 PM
Registered User
 
Join Date: Jun 2003
Location: oregon
Posts: 145
Thanks: 0
Thanked 0 Times in 0 Posts
blackoutspy is on a distinguished road
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?
Reply With Quote
  #4  
Old August 15th, 2003, 01:40 AM
slur's Avatar
Geek / Hedonist
 
Join Date: Dec 2000
Location: Florence, MA
Posts: 542
Thanks: 0
Thanked 0 Times in 0 Posts
slur is on a distinguished road
AppleScript possibilities

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.
__________________
|
| slur was here
|

check out my creative music software

Last edited by slur; August 15th, 2003 at 01:45 AM.
Reply With Quote
  #5  
Old August 16th, 2003, 05:41 AM
Arden's Avatar
Don't drink and derive.
 
Join Date: Dec 2002
Location: San Francisco
Posts: 7,743
Thanks: 0
Thanked 0 Times in 0 Posts
Arden is on a distinguished road
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.
__________________
System:
2.5 GHz MacBook Pro Core 2 Duo, 4 GB RAM, 200 GB hard drive, runs 10.5.4
1.6 GHz iMac G5, 1.5 GB RAM, 250 GB hard drive, runs 10.4.11
iPhone, 4 GB, OS X 2.0.2
Reply With Quote
Reply

Thread Tools

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 Off
Pingbacks are Off
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[HOWTO] - Use niutil gatorparrots HOWTO & FAQs 6 December 10th, 2002 03:24 PM
Getting a CGI script to work locally on my Mac simX Mac OS X System & Mac Software 11 July 12th, 2002 01:43 PM
login script help emh_alpha1 Unix & X11 5 July 4th, 2002 09:49 PM
HOW TO STOP SPAM -- join the fight! GadgetLover Apple News, Rumors & Discussion 11 April 11th, 2002 02:52 PM
AppleScript front end to a shell script? meancode Mac OS X System & Mac Software 0 March 17th, 2002 08:25 PM


All times are GMT -5. The time now is 01:26 AM.


Mac Support® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2000-2008 DigitalCrowd, Inc.