Javascript for automation quastions
Javascript for automation quastions
- Subject: Javascript for automation quastions
- From: Deivy Petrescu <email@hidden>
- Date: Thu, 11 Dec 2014 11:00:29 -0500
Some questions that I could not find the answer (plenty more to come).
First, how does one get “me” in JSA ?
Example:
<script>
set k to path to me
</script>
Note: me points to <<scrpt>> not to the “front” document.
Second, “runScript", according to the dictionary it takes text:
"run script script : the script text (or an alias or file reference to a script file) to run”
In AppleScript the following works:
<script>
run script "Tell app \"Mail\" to activate”
</script>
In JSX the following does not work
<script>
se = Application.currentApplication()
se.includeStandardAdditions = true
scrpt= "Application('Mail').activate()"
se.runScript(scrpt)
</script>
——>Error:"Error on line 6: Error: Expected script but found string.”
However if I try the following works, but it throws an error
<script>
se = Application.currentApplication()
se.includeStandardAdditions = true
se.runScript(Application('Mail').activate())
</script>
—>Error: "Error on line 5: Error: Expected script but found boolean.”
In both JSA scripts the error line is the last line
Is this an error on the JSA dictionary?
What is the point of JSA taking a script instead of text?
If you put the script into a variable it will execute before the call to runScript.
Thanks
Deivy Petrescu
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden