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 ?
if app_name is "InCopy then
tell application "InCopy"
You have to use "using terms from" to get it to compile:<br /><br />set appName to "Adobe InCopy CS3"<br />using terms from application "Adobe InDesign CS3"<br /> tell application appName<br /> -- whatever<br /> end tell<br />end using terms from<br /><br />-- <br />Shane Stanley <email@example.com>