3 Replies Latest reply on Sep 30, 2008 3:11 AM by (Schedule_Boy)

    Can i use "current application" to have 1 script work on 2 applications? (AS)

      I have some scripts that I want to use on both InDesign and InCopy. They already work properly on both, the only difference is the tell command to identify the application. To save maintaining 2 scripts I would like to combine them into one.

      I can get the parent application of the script with.

      set the_application_name to name of current application

      now i want to use this variable in my tell statement e.g

      tell application the_application_name

      but it wont compile because AS doesn't know what application to compile against.

      Is there a way to do this without repeating the whole script ?

      something like....

      if app_name is "InCopy then
      tell application "InCopy"

      tell application "InDesign"