Become a MacRumors Supporter for $25/year with no ads, private forums, and more!
  • Did you order new AirTags? We've opened a dedicated AirTags forum.

Sverkel

macrumors regular
Original poster
Jul 3, 2007
128
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
 

0d085d

macrumors regular
Apr 23, 2015
154
12
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
 
Comment

Sverkel

macrumors regular
Original poster
Jul 3, 2007
128
3
Denmark
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:
Comment
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.