Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
system()
Copy link to clipboard
Copied
Hi Kukurykus,
Sorry, i can not get your answer.
Thanks
Asuvath
Copy link to clipboard
Copied
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
Hi Kukurykus,
Thanks. Sorry i am unable to download that guide, can you please email (asuvathdhamank@gmail.com) me if possible?
Thanks
Asuvath
Copy link to clipboard
Copied
Log in and download documentation to read this part:
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.
Copy link to clipboard
Copied
You may need to compile the AS code into an app, then call the app from the JS.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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.");
};
}
Copy link to clipboard
Copied
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