applescript executable launch an applescript


Sorry for my rusty english, i m french. My question is:
Is it possible and HOW launch and run an applescript in using an applescript executable ? why?because my applescript will be change by an external application but not executable.

thanks for answers

best regards

I am not sure I follow exactly what you want, but I whatever it is should be possible.

Let me see if I got it right:
You want an applescript (droplet, application, or compiles script) to be executed. When this applescript (scriptA) is executed, you then want it to get an applescript from another source (scriptB) and run it. ScriptA won’t change, but ScriptB may change.

If this is what you want to do, then you can try this.

scriptA: --save this as an application

set scriptPath to "Queen Elvis:Users:bhays:Desktop:scriptB" --path to scriptB

set scriptB to (load script file scriptPath)

run scriptB

scriptB:–save this as a compiled script

display dialog "Script B: Hello World!"

When you run scriptA, it will load the code from scriptB and run it from within scriptA.
Now, you should be able to change scriptB and scriptA will run it. There are some more advanced ways to do this, but I don’t know how detailed you want to go into it.

Hope this helps

yes it is but i have another problem, there is a window which ask me if i really want to run scriptB, is there a solution for this problem and another question about MAC in general, how in MAC note the relative path (sorry for my english >> french), in PC is like …/temp/toto.html, and in MAC OS ???(i start on mac system :-))

thanks in advance

  • nicolas

This sounds like an interesting project.

You want to have an applescript applet running on a machine that accepts arbitrary AppleScript code requests and runs them. You want to be able to bypass any confirmation by the user.

Does this sound at all like the security hole in Help Viewer that was recently patched? This doesn’t sound like a good idea to me.


I made something similar some time ago.
It was thought to pick applescript code from web pages and:
-copy to the clipboard, or
-execute, or
-check syntax, or
-save as script/applet.
Similar to the new “applescript” protocol.
To execute code (the dangerous part) It showed a little confirm screen, where you could also preview the code-to-execute.
I allways thought it was a pretty interesting project with lots of possibilities (the best attempt for me was the AppleScriptPlugin by Eddy Walet): online installers, personalized help systems, network applications, blah.

There is a preference for whether or not this dialog is shown to the user. When you save a script application, uncheck the checkbox that says “Show Startup Screen”. Um… the checkbox is probably labeled differently on a French system. :slight_smile: