Applescript - telling multiple applications to do something?

Discussion in 'Mac Programming' started by kasakka, Mar 23, 2010.

  1. kasakka macrumors 68020

    Oct 25, 2008
    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?
  2. mysterytramp macrumors 65816


    Jul 17, 2008
    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.


Share This Page