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

kasakka

macrumors 68020
Original poster
Oct 25, 2008
2,416
1,180
Is there any easier way to tell several applications to do the same thing?

I have an Applescript that moves my browsers to the center of the display based on resolution and resizes them from top to bottom. Now I just repeat the script for each browser (Firefox, Chrome, Safari) by checking if the process exists and then telling the app to go to position and resize itself.

So basically is there a syntax to do "check if the browsers are open and then do the same things to each of them" without repeating the code for each browser?
 
There might be some tricks in getting the processes, parsing which ones you want into a variable, then "tell application variable" the messages you want. However, you'd probably be doing as much typing as you would if you just entered tell blocks for the apps.

mt
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.