I believe that my script doesn't work because i don't understand the
"document" element or object or property or whatever it's called.
Obviously, I 'm not going to use this script to just display dialog boxes, I'm actually trying to get firefox to wait for a page to load and then login for me. I already have a script that works but it works by using a 5 second delay and sometimes that seems way to long and other times it's just about right, depending on how fast the page loads. So I guess technically this is my second applescript but the first one was just a copy and paste from a website.
Even if there is a better way of accomplishing what I want, please explain where I went wrong with my current code, and then if there is a better way, please let me know that as well.
Here's the current code that I would like to know why it returns false no mater whether i have the page open or not:
and I've tried
The difference on this last one, is I removed the word "document" after "if exists"
This one always returns true whether I have the page open in a tab or not.
Which brings up another question. Is there some way of scripting to work with tabs in firefox? I have only saw scripts for windows in firefox, not tabs, so far in my searching the internet.
Thanks.
"document" element or object or property or whatever it's called.
Obviously, I 'm not going to use this script to just display dialog boxes, I'm actually trying to get firefox to wait for a page to load and then login for me. I already have a script that works but it works by using a 5 second delay and sometimes that seems way to long and other times it's just about right, depending on how fast the page loads. So I guess technically this is my second applescript but the first one was just a copy and paste from a website.
Even if there is a better way of accomplishing what I want, please explain where I went wrong with my current code, and then if there is a better way, please let me know that as well.
Here's the current code that I would like to know why it returns false no mater whether i have the page open or not:
Code:
[B]tell application "Firefox" to activate
if exists document "logon.php" then
tell application "Finder"
display dialog "logon.php exists"
end tell
else
tell application "Finder"
display dialog "logon.php does not exists"
end tell
end if
[/B]
I also tried
[B]tell application "Firefox" to activate
if exists document "http://www.somewebsite.com/AircraftScheduling/logon.php" then
tell application "Finder"
display dialog "logon.php exists"
end tell
else
tell application "Finder"
display dialog "logon.php does not exists"
end tell
end if
[/B]
Code:
[B]tell application "Firefox" to activate
if exists "logon.php" then
tell application "Finder"
display dialog "logon.php exists"
end tell
else
tell application "Finder"
display dialog "logon.php does not exists"
end tell
end if
[/B]
This one always returns true whether I have the page open in a tab or not.
Which brings up another question. Is there some way of scripting to work with tabs in firefox? I have only saw scripts for windows in firefox, not tabs, so far in my searching the internet.
Thanks.
Last edited by a moderator: