mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-25 04:57:03 +00:00
50 lines
2.0 KiB
Plaintext
50 lines
2.0 KiB
Plaintext
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
<plist version="1.0">
|
|
<dict>
|
|
<key>beforeRunningCommand</key>
|
|
<string>nop</string>
|
|
<key>command</key>
|
|
<string>### Refresh All Active Browsers - OmniWeb, Safari, Firefox & IE
|
|
### v1.0. 2005-03-29
|
|
###
|
|
|
|
# Check if Internet Explorer is running, if so refresh
|
|
ps -xc|grep -sq "Internet Explorer" && osascript -e 'tell app "Internet Explorer"' -e 'activate' -e 'OpenURL "JavaScript:window.location.reload();" toWindow -1' -e 'end tell'
|
|
|
|
# Check if OmniWeb is running, if so refresh
|
|
ps -xc|grep -sq OmniWeb && osascript -e 'tell app "OmniWeb"' -e 'activate' -e 'reload first browser' -e 'end tell'
|
|
|
|
# Check if Firefox is running, if so refresh
|
|
ps -xc|grep -sqi firefox && osascript <<'APPLESCRIPT'
|
|
tell app "Firefox" to activate
|
|
tell app "System Events"
|
|
if UI elements enabled then
|
|
keystroke "r" using command down
|
|
-- Fails if System Preferences > Universal access > "Enable access for assistive devices" is not on
|
|
else
|
|
tell app "Firefox" to Get URL "JavaScript:window.location.reload();" inside window 1
|
|
-- Fails if Firefox is set to open URLs from external apps in new tabs.
|
|
end if
|
|
end tell
|
|
APPLESCRIPT
|
|
|
|
# Check if Safari is running, if so refresh
|
|
ps -xc|grep -sq Safari && osascript -e 'tell app "Safari"' -e 'activate' -e 'do JavaScript "window.location.reload();" in first document' -e 'end tell'
|
|
|
|
# Check if Camino is running, if so refresh
|
|
ps -xc|grep -sq Camino && osascript -e 'tell app "Camino"' -e 'activate' -e 'tell app "System Events" to keystroke "r" using {command down}' -e 'end tell'
|
|
</string>
|
|
<key>input</key>
|
|
<string>none</string>
|
|
<key>name</key>
|
|
<string>Refresh Running Browser(s)</string>
|
|
<key>output</key>
|
|
<string>discard</string>
|
|
<key>scope</key>
|
|
<string>source.js.objj</string>
|
|
<key>uuid</key>
|
|
<string>033BC36A-97DA-4F48-9ACB-B58C80D1A689</string>
|
|
</dict>
|
|
</plist>
|