Skip to main content
bugnard_user_1
Participant
November 29, 2019
Answered

Scripting - #target directive failed

  • November 29, 2019
  • 2 replies
  • 2755 views

Hi,

The weird thing about the day 

A double click on the file test.jsx with the following content, run fine, InDesign start and a popup window appears :

 

#target indesign
alert("Hello InDesign");

 

 The following script fails :

 

#target photoshop
alert("Hello Photoshop");

 

 with the followinf error message :

 The target "photoshop" is unknown. would you like to open the file to change it ?

(translated from french)

And if I run the script from the Extendscript Toolkit editor, I get :

"photoshop" is undefined!

Strange. Any idea why this doesn't work anymore?

Thanks

Windows 7, Photoshop 21.0.1, 

 

This topic has been closed for replies.
Correct answer r-bin
I do not use these directives and usually delete the Startup Scripts CS6 (CC) folder.

What version of ExtendScript Toolkit?
If version 3.8.0.12 (CS6) is assigned to the jsx extension, then it doesn’t work for me either.
If launch 4.0.0.1 (CC) is assigned to jsx, then photoshop 2020 starts wonderfully and the script works.
 

2 replies

JJMack
Community Expert
Community Expert
November 29, 2019

There are specific photoshop versions you can Target when using extendScript Toolkit.  Ther are sever versions of extendScript.   I do not use any excepr for  their object model viewer

With extendscript CC if I just use #target photoshop without the -number string if Photoshop is not running it will want tp launch Photoshop 2020  -140.064. I CS6 is running it will still want to launch Photoshop 2020 but will not be able to on my Windows system.  Only one version of Photoshop can be up and running on Windows.

If I close CS6 Photoshop will not then start automatically

However, if I then start Photoshop 2020 the script will run.

JJMack
bugnard_user_1
Participant
December 2, 2019

Thank you very much for this clarification.

r-binCorrect answer
Legend
November 29, 2019
I do not use these directives and usually delete the Startup Scripts CS6 (CC) folder.

What version of ExtendScript Toolkit?
If version 3.8.0.12 (CS6) is assigned to the jsx extension, then it doesn’t work for me either.
If launch 4.0.0.1 (CC) is assigned to jsx, then photoshop 2020 starts wonderfully and the script works.
 
bugnard_user_1
Participant
December 2, 2019

That was my problem. I hadn't noticed that it was the wrong version of ExtendScript Toolkit starting.

 

Thank you very much !