|
|
#1 |
|
Triple-A Player
Join Date: Nov 2004
Posts: 77
|
Sometimes, on Safari (or any web brower)
I have to keep on reloading the page. I want an apple script to to do this rather than keep on pressing Command-R, but can't find any. Can anybody help. I done a type of version, but its a bit rubbish, and doesn't work! Here it is neway: tell application "Firefox" keystroke command + (ASCII character 114) repeat 10 times end repeat end tell the problem is the command button, as I can't find an ASCII character, can anybody help. Also, is there any way that I can make it repeat it self after something like a minute? Thanks in advance, and sorry if I put this in the wrong place.
__________________
I ain't what i should be, I ain't what i will be, but I ain't what i was. |
|
|
|
|
|
#2 |
|
Triple-A Player
Join Date: Aug 2004
Location: Cleveland, OH
Posts: 168
|
The gist of what you need is simply this:
Code:
repeat open location "http://www.apple.com" delay 60 end repeat Carl. |
|
|
|
|
|
#3 |
|
All Star
Join Date: Jan 2002
Location: sacramento, ca
Posts: 857
|
im just learning AS myself. but, as far as i know the only access you have to the command, control, option, shift buttons is via UI scripting. to enable that you need to go to System Preferences->Universal Access and check the 'Enable Access for Assistive Devices'.
then, you can communicate directly with system events as opposed to the application itself. additionally, if you want to reload pages periodically but dont explicitly release the script from hogging the processor you will cause AS to eat up cycles. so, i'd use the idle command to page the system for the action. something like this: Code:
on idle
-- the applescript only calls attention to itself when the idle period is up
tell application "Safari"
--confirms your browser is the front application
activate
end tell
tell application "System Events"
tell process "Safari"
keystroke "r" using {command down}
end tell
end tell
--sets the idle period in seconds. i.e. safari will refresh every 10 seconds
return 10
end idle
|
|
|
|
|
|
#4 |
|
Triple-A Player
Join Date: Nov 2004
Posts: 77
|
Thank you both, Carl and cudaboy. You both helped a lot.
I know a bit more about AS! Yay! Thanks again
__________________
I ain't what i should be, I ain't what i will be, but I ain't what i was. |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|