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

Applescript code in Javascript in Photoshop

Participant ,
Apr 14, 2021 Apr 14, 2021

Hi,

I have develop the appleScript code in Javascript for Photoshop (see below coding) to open particular "html" in safari browser. 

 

var htmlPth = "/Users/asuvathdhamank/Desktop/Asuvath/Image Export Tool/HTML/index.html"; openHTML_Safari(htmlPth);

function openHTML_Safari(url){

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

app.doJavaScript(body, ScriptLanguage.applescriptLanguage);

}


But this script is not working, can anyone check and help me from out from this?


thanks

Asuvath

TOPICS
Actions and scripting
1.0K
Translate
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
Community Expert ,
Apr 14, 2021 Apr 14, 2021
Translate
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 14, 2021 Apr 14, 2021

Hi Stephen,
Thanks for checking on this.
My original script is JavaScript, i have included "AppleScript" on that, but the above link have reversely Applescript run the javaScript.

 

Can you please advise how do i run the appleScript code in Javascript with Photoshop.

Thanks
Asuvath

Translate
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 14, 2021 Apr 14, 2021
system()
Translate
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 14, 2021 Apr 14, 2021

Hi Kukurykus,

Sorry, i can not get your answer.

 

Thanks

Asuvath

 

Translate
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 14, 2021 Apr 14, 2021
Translate
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 14, 2021 Apr 14, 2021

Hi Kukurykus,

 

Thanks, but in this link there are several sub links, so can you please give me the exact links to refer for this issue?

 

Thanks

Asuvath

Translate
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 14, 2021 Apr 14, 2021

Hmm, my bad. I was sure there's explanation of Photoshop app.reflect.methods[33]. For some reason there's nothing about also in JavaScript Tools Guide, but I found it in Bridge JavaScript Reference (on one page) that you can download from https://console.adobe.io/downloads/br  

Translate
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 15, 2021 Apr 15, 2021

Hi Kukurykus,

 

Thanks. Sorry i am unable to download that guide, can you please email (asuvathdhamank@gmail.com) me if possible?

Thanks

Asuvath

Translate
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 15, 2021 Apr 15, 2021
LATEST

Log in and download documentation to read this part:

 

quote
app.system (commandLine)

Issues the argument to the operating system, as if it were entered on
the command line in a shell. Control does not return to Bridge until this
function returns. Returns undefined.

commandLine The command to pass to the operating system.
Translate
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
Community Expert ,
Apr 14, 2021 Apr 14, 2021

You may need to compile the AS code into an app, then call the app from the JS.

Translate
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 15, 2021 Apr 15, 2021

Hi Stephen,

 

Thanks for the information, i tried this idea too. The html doc will be dynamic, so if created as App, i am struggling to get the input (HTML doc) for user.


Can you please guide me, how do i pass the parameter (HTML Doc) from javascript to appliscript created App.

Thanks

Asuvath

Translate
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
Community Expert ,
Apr 14, 2021 Apr 14, 2021

Try throwing the HTML file to your OS to open with the application  the user has associated with HTML files.  I have nor recieved a bur report froe a mabt user the my Help button doe not work.  I run Windows know nothinf avout Apple Script. My scripts are javascript only.

function help() {
	try{
		var URL = new File(Folder.temp + "/PhotoCollageToolkit.html");
		URL.open("w");
		URL.writeln('<html><HEAD><meta HTTP-EQUIV="REFRESH" content="0; url=http://www.mouseprints.net/old/dpr/PhotoCollageToolkit.html"></HEAD></HTML>');
		URL.close();
		URL.execute();
	}catch(e){
		alert("Error, Can Not Open.");
	};
}
JJMack
Translate
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 14, 2021 Apr 14, 2021

Hi JJMack,

 

Thanks for the checking. Actually i would like to open the html document in specific browser "Safari".

But in this code there is no any specification for the browser. Can you please check and help me to out from this.

 

Thanks

Asuvath

Translate
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