Skip to main content
joysons60516767
Participant
October 11, 2018
Question

how to execute applescript .scpt from Javascript

  • October 11, 2018
  • 1 reply
  • 750 views

I have put 'do shell script' to my .scpt which should run after the Javascript. Here, .scpt will be changed per file where I can't make that as '.app' to execute as application.

Also kindly help me to load the scripts in File>Scripts>OtherScripts without user interaction from Javascript.

This topic has been closed for replies.

1 reply

Silly-V
Legend
October 11, 2018

I'm not sure if a javascript can install the script into the application folder without some kind of user permission interaction. Although , I have never tested this out as of yet.

In order to run applescript from javascript, I've had to make an "AppleScript-Executor.app" .app which can be triggered by jsx's file.execute() method. If this app's code tells it to always run a .scpt file in a certain location, you can write the .scpt dynamically from the jsx and execute the .app which would run it. For cleanup, the .app could remove the file too.