Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Sverkel

macrumors regular
Original poster
Jul 3, 2007
140
3
Denmark
Hi. So I got my new 27" Dell monitor and I have noticed that when I resize my apps on my MacBook Air when connected to the monitor the apps no longer fill the screen on the MacBook Air when not connected to the monitor and the other way around. So i'm trying to make a "fix" with some Apple Script. As of now I have made two apps, the one resizes the apps to the size I like when connected to the monitor and the other one for the MacBook Air. But when I activate the script it opens all the apps I have chosen, so here comes my question. Is there some way I can tell the same script to close the apps after the have been activated?

As of now I got this code in my script.

Code:
tell application "lala1" to activate
tell application "lala2" to activate
tell application "lala3" to activate
 
Hi. So I got my new 27" Dell monitor and I have noticed that when I resize my apps on my MacBook Air when connected to the monitor the apps no longer fill the screen on the MacBook Air when not connected to the monitor and the other way around. So i'm trying to make a "fix" with some Apple Script. As of now I have made two apps, the one resizes the apps to the size I like when connected to the monitor and the other one for the MacBook Air. But when I activate the script it opens all the apps I have chosen, so here comes my question. Is there some way I can tell the same script to close the apps after the have been activated?

As of now I got this code in my script.

Code:
tell application "lala1" to activate
tell application "lala2" to activate
tell application "lala3" to activate
Just:

Code:
tell applicaton "lala1" to quit

or have I misunderstood your problem?

You might need to add a few delays in there just to let the application load etc.

Code:
tell application "lala1" to activate
tell application "lala2" to activate
tell application "lala3" to activate
delay 5
tell application "lala1" to quit
tell application "lala2" to quit
tell application "lala3" to quit
 
Just:

Code:
tell applicaton "lala1" to quit

or have I misunderstood your problem?

You might need to add a few delays in there just to let the application load etc.

Code:
tell application "lala1" to activate
tell application "lala2" to activate
tell application "lala3" to activate
delay 5
tell application "lala1" to quit
tell application "lala2" to quit
tell application "lala3" to quit

I tried that but it won't work :(

Got it to work! Just had to replace the lala part with the actual app name that had to be closed ;)

Thank you! :)
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.