Hi. I’m new to AppleScript and I’m wondering if anyone can tell me if it’s capable of doing the following:
do you need it to pause.
if you use a script like the example below, it will wait until each action is completed.
tell application "Safari"
set t to source of document 1
do shell script "echo " & quoted form of t & " > test1.html"
do shell script "echo " & quoted form of g & " > test2.html"
If you look at the source of the new file you will see the my java script
Thanks for the link Peter. I’m looking to launch Safari from a script, and have the script tell Safari which pages to load. The doc you link to has it kinda the opposite way around (Safari launching the script (as a handler)).
Mark: yeah, inserting the script isn’t so much my problem (see the “so far so good” comment above). It’s the passing control back and forth between the script and Safari. I.e. making the script pause and wait for the Web page to do its stuff before it (the Web page) tells the script to continue.
On further reading of the Apple docs, I think probably AppleScript isn’t the right tool for the job. I probably need to write a basic cocoa app that wraps Web Kit.