Are the following statements equivalent
var bt = new BridgeTalk;
bt.target = "photoshop";
and
#target photoshop
I am trying to get clear exactly when the target needs to be specified. Is this right:
1. When running scripts from one app which require a different app (eg from bridge for photoshop or from photoshop for bridge.
2. For all scripts in the StartupFolder.
3. Not required for scripts to be run in the app from which they are called (for example, PS assumes that a script run from it's own script menu is for PS).
Second question, can you wrap a target statement in an if statement eg:
if (app.version[0] == '9') {
# target photoshop
}
to prevent syntax errors with CS1
I found what looks like a minor bug with the target statement today. The first characters of a script were
#target photoshop
When run from photoshop directly, no problem. When run as an include from another photoshop script I got Error 8: Syntax error #target photoshop. If I put a linebreak before the #target, no error either way.
Andrew