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

Convert applescript to javascript

Guest
Jul 30, 2010 Jul 30, 2010

I have a file which contains applescript. I need to convert this script to javascript  and run it in my windows. Please help!!!

TOPICS
Scripting
3.6K
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
Advisor ,
Jul 30, 2010 Jul 30, 2010

Hey!

Maybe you can try to run it with doScript like this:

app.doScript(File(app.activeScript.path+'/'+'your_apple_script_file'), ScriptLanguage.APPLESCRIPT_LANGUAGE);

tomaxxi

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
Guide ,
Jul 30, 2010 Jul 30, 2010

Tomaxxi, I doubt very much that that is going to work? I thought that calling app.doScript() was only platform independent when calling another JavaScript? If your are to perform an OS level script you should make an OS check the perform either VB or AppleScript dependent on the result. It sounds to me that the OP wanted the called script translated and performed on Windows? Or may be I just read the post wrong?

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
People's Champ ,
Jul 30, 2010 Jul 30, 2010
LATEST

Muppet Mark seems right.

Translating APS to JS is someway doable. Unless the APS script uses cmd that don't have matching items in JS, it shouldn't be a problem.

However, I don't think a script may convert  all by itself an APS script to JS.

For generic commands such as "set x to" or "display dialog", it's quite easy but how to translate "whose", "starts", "first", "last"....?

What if the script goes for file on the system using a tell application "Finder" block ?

In my opinion, the translation process can only be efficiently done by a someone knowing both languages.

Can I help you ?

Loic

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