I have an AppleScript that I have written and finally debugged. It is intended to be used while using the Xojo IDE. Currently, I am using KeyboardMaestro to launch this AppleScript. KeyboardMaestro has a hot key assigned to a macro. The only thing that the KeyboardMaestro macro does is launch this particular AppleScript.
What I would like is to free myself from this dependance on KeyboardMaestro.
I currently have an IDE script that does a few things. I fire off that script and when it has finished, I launch manually (with the hot key) the KeyboardMaestro script to complete the intended task using AppleScript. Would I would like is to have the final command of the IDE Script be a command that launches my AppleScript.
I have not been able to figure out exactly how to do this (or whether it is doable)
Well, I’ve been led to water, but I still cannot drink. A little embarrassed but I will post my IDE Script. I run it, and nothing happens beyond the notification that the IDE Script itself did run.
So I presume that something is wrong with my substitution, but I have tried lots of variations and no success so I am back asking for help.
I have what I take to be the script path working in KeyboardMaestro. This path is copied from there.
When I run the IDE Script below nothing happens (except notify me that the IDE Script itself ran). The AppleScript does not.
Dim allDone As String = “Finished”
Print (allDone)[/code]
Norman, I had been to that page and thanks for the reference. But that page is over my head in terms of actually knowing what the command would be to launch an AppleScript.
Norm, thanks for sticking with me. Kept playing with the quotation marks until it finally came together.
Dim result As String
result = DoShellCommand ("osascript ""/Users/owl/Library/Mobile Documents/com~apple~ScriptEditor2/Documents/160609Experiment.scpt""")
This works as the answer to my original question.
It is long path name so it is arbitrarily wrapping, in this Xojo forum environment, at Mobile Documents . It is not actually a new line (although there is a space between Mobile & Documents.)
For me, being able to do this is fabulous!
The AppleScript itself is 160609Experiment.scpt, and you are passing its entire path in this formulation, and it is successful.
One can do really nice stuff with DoShellCommand and osascript.
Once upon a time I had to do a sudo shell command when building. Because DoShellCommand can’t do this I had a DoShellCommand calling a AppleScript with osascript calling a shellscript. The osascript was called “with privileges” and my password.