Basically I’m trying to loop an action”making a post on a certain forum with IE, and I got pretty much got it to work except it repeats the action in a separate window, and I want the action in only one.
You must set your Preferences from the Explorer menu, Interface Extras option:
“When another app asks IE to go to a page”->{use front browser window}
once you do that, the code
has the repeat outside the “tell” statement. Move the repeat around the whole block
repeat 5 times
tell application "Internet Explorer"
OpenURL "http://www.forumplanet.com/doc/post.asp?fid=1421&tid=1651324&rid=18689244&t=3&rn=test"
delay 8--*The delay in seconds must be set to "longer than it takes to load the page"
OpenURL "javascript:checkRequired(frmNew, true);"
end tell
delay 5--*The delay in seconds must be set to "longer than it takes to load the page"
end repeat
The delays wait for the pages to load so every thing runs smoothly. I’m on cable modem, so a 56k would have a substantially larger delay.
SC
Okay, just one more question. Is there a way to open multiple windows at the same time? As in “openurl http://www.blahblahblah.com 3 times”, but in correct syntax.
tell application "Internet Explorer"
repeat 3 times
run
end repeat
end tell
That opened 3 windows at the same time. If you wanted to combine that with the previous script so that each window ran the process:
tell application "Internet Explorer"
repeat 3 times
run
repeat 5 times
tell application "Internet Explorer"
OpenURL "http://www.forumplanet.com/doc/post.asp?fid=1421&tid=1651324&rid=18689244&t=3&rn=test"
delay 8 --*The delay in seconds must be set to "longer than it takes to load the page"
OpenURL "javascript:checkRequired(frmNew, true);"
end tell
delay 5 --*The delay in seconds must be set to "longer than it takes to load the page"
end repeat
end repeat
end tell
Well the first one worked, but the second one doesn’t actually open multiple windows. I messed around with the script a little, but I’m stumped.
Edit: I sorta got it to work. It opens multiple windows, but it waits for the first window to finish before it moves on to the second.
tell application "Internet Explorer"
repeat 3 times
run
end repeat
repeat 5 times
tell application "Internet Explorer"
OpenURL "http://www.forumplanet.com/maddipper/post.asp?fid=1481&tid=1678160&t=2&rn=gg"
delay 8 --*The delay in seconds must be set to "longer than it takes to load the page"
OpenURL "javascript:checkRequired(frmNew, true);"
end tell
end repeat
end tell