Re: Repeat
Re: Repeat
- Subject: Re: Repeat
- From: Andrew Oliver <email@hidden>
- Date: Wed, 21 May 2003 09:59:25 -0700
Your problem is that you're not talking to Safari at all.
The 'open location' command is a standard system event that opens a URL in
your default web browser. It's as much coincidence as anything else that it
opens in Safari.
That said, since you are using Safari as your default, Safari's preferences
have an option to open links from other applications in a new window or the
current window. You could change your Safari preferences to get what you
want.
Alternatively, doing it the AppleScript way, change the open location line
to:
set URL of document 1 to (some item of theURL)
This will set Safari's front window to the specified URL.
Finally, using the delay (60 * 60) is OK, but there has been some discussion
her regarding the processor usage of the 'delay' command. You'd be better
off using an idle handler:
property theURL : {"
http://www.apple.com.br", "
http://www.apple.com"}
on idle
tell application "Safari"
activate
set URL of document 1 to (some item of theURL)
end tell
return (60 * minutes) -- come back in one hour
end idle
on run
idle -- just call the idle handler when run
end run
Saved as a stay-open application, this will be a more efficient solution.
Andrew
:)
On 5/21/03 4:52 AM, "Marcus Rodrigues" <email@hidden> wrote:
>
Hi, i was tryng to do the following:
>
>
Open in Safari, in intervals of one hour, a random page. I think i got
>
it, but i want the pages to load in the same window, not in another...
>
How do i script this part?
>
>
>
Here is what i have done till this moment:
>
>
>
tell application "Safari"
>
activate
>
set theURL to {"http://www.apple.com.br", "http://www.apple.com"}
>
repeat
>
open location (some item of theURL)
>
delay (60 * 60)
>
end repeat
>
end tell
>
>
>
Thx for ur help. =D
>
>
>
>
o#? Marcus Rodrigues o#?
>
iBook 600 - Combo - Jaguar
>
CC4nsul do Brasil Apple Clube - Caxias do Sul
>
ichat: marcusrodrigues
>
mailto:email@hidden
>
http://homepage.mac.com/marcusrodrigues
>
_______________________________________________
>
applescript-users mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/applescript-users
>
Do not post admin requests to the list. They will be ignored.
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.
References: | |
| >Repeat (From: Marcus Rodrigues <email@hidden>) |