• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

app.doScript not working in Photoshop

Participant ,
Apr 16, 2021 Apr 16, 2021

Copy link to clipboard

Copied

Hi,


I have developed the script for Photoshop (see below coding), this will not run and show the error on "app.doScript(body, ScriptLanguage.applescriptLanguage)" line. But this script is successfully run in InDesign.

 

Can any one look into this and provide the solution for run this code in Photoshop?

Please note, i have used "doJavaScript" commands too, but still show the error.

 

var htmlDoc = "/Users/asuvathdhamank/Desktop/Asuvath/New_Development/index.html" openHTML_Safari(htmlDoc);

function openHTML_Safari(htmlDoc){

var body = 'tell application "Safari"\ropen POSIX file "'+htmlDoc+'"\rend tell';

app.doScript(body, ScriptLanguage.applescriptLanguage);

}

Please note, i have write this code, particularly that html document should be opened in "Safari" Browser.

Thanks
Asuvath

TOPICS
Actions and scripting

Views

443

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
LEGEND ,
Apr 16, 2021 Apr 16, 2021

Copy link to clipboard

Copied

No doScript method in ExtendScript for Photoshop. Try somehow with system()

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Apr 16, 2021 Apr 16, 2021

Copy link to clipboard

Copied

Hi Kukurykus,

Thanks for checking. I have used system () method, but again it shows error, i am not sure where am i made mistake in the code. Can you please correct it?

var htmlDoc = "/Users/asuvathdhamank/Desktop/Asuvath/New_Development/index.html" openHTML_Safari(htmlDoc);

function openHTML_Safari(htmlDoc){

app.system('tell application "Safari"\ropen POSIX file "'+htmlDoc+'"\rend tell');

}

 

Thanks
Asuvath

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 16, 2021 Apr 16, 2021

Copy link to clipboard

Copied

Write your code to the disk and by Photoshop script that uses system() run the file.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 16, 2021 Apr 16, 2021

Copy link to clipboard

Copied

System() is not a drop in replacement for doScript. Read the docs! It runs shell commands in Mac. You could use the osascript shell command or even just the open shell command. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 16, 2021 Apr 16, 2021

Copy link to clipboard

Copied

LATEST

That should work, osascript in system 😉

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines