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

doScript not working

Engaged ,
Mar 02, 2010 Mar 02, 2010

Hi All,

below doscript code not working with onClick event. But when i try this without onClick event its working fine. What's wrong with it?

dialog.IconButton.onClick = function()

{

var openurl = "tell application \"Safari\"\ractivate\rdo JavaScript \"window.open('http://www.yahoo.com')\" in document 1\rend tell"

app.doScript(openurl, ScriptLanguage.applescriptLanguage)

}

Any other suggestion for goto URL on click on image button in Javascript or with Applescript.

Thanks,

Shonky

TOPICS
Scripting
1.5K
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

correct answers 1 Correct answer

LEGEND , Mar 02, 2010 Mar 02, 2010

var linkJumper = File(Folder.temp.fullName+"/In-Tools.html");

linkJumper.open("w");

var linkBody = '<html><head><META HTTP-EQUIV=Refresh CONTENT="0; URL=http://in-tools.com"></head><body> <p></body></html>'

linkJumper.write(linkBody);

linkJumper.close();

linkJumper.execute();

Harbs

Translate
LEGEND ,
Mar 02, 2010 Mar 02, 2010

I HATE JIVE!

I responded to this many hours ago, but the email disappeared into Jiveland...

I just happened to browse the web view, and noticed that my reponse never made it...

Here was my response:

Is it a dialog or a palette?

app.doScript() does not work when a modal dialog is open. If you want to use app.doScript(), you'd need to either use a palette/window instead of a dialog, or close the dialog before the doScript().

The other option is writing a html launcher file and executing that...

Harbs

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
Engaged ,
Mar 02, 2010 Mar 02, 2010

Hi Harbs,

Thank you very much for replying.

I am using doScript with dialog.

Can you please show a sample of html launcher file because i have not any idea regarding this.

Thanks,

Shonky

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 ,
Mar 02, 2010 Mar 02, 2010

var linkJumper = File(Folder.temp.fullName+"/In-Tools.html");

linkJumper.open("w");

var linkBody = '<html><head><META HTTP-EQUIV=Refresh CONTENT="0; URL=http://in-tools.com"></head><body> <p></body></html>'

linkJumper.write(linkBody);

linkJumper.close();

linkJumper.execute();

Harbs

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
Engaged ,
Mar 02, 2010 Mar 02, 2010
LATEST

Thanks again,

Shonky

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