|
#9
| |||
| |||
|
what about a script that will prompt the user for the URL they want to open and then open that URL in say IE, Camino, Safari, and Netscape? Now, that would be a useful script for me when developing websites.
__________________ Kalantna 10.3.3 iMac 800 mhz, 768 MB RAM, 60 GB HD, nVidia Gforce2 10.3.3 Titanium Powerbook 800 mhz, 1 gig RAM, 30 GB HD, ATI Radeon 8500 Windows XP Dimension 8300 2.66 ghz, 1256 MB RAM, 120 GB HD, 64 MB Gforce4 |
|
#10
| ||||
| ||||
| Code: display dialog "Open in" buttons {"Cancel", "All Browsers", "Just Safari"} default button 3
copy the result as list to {the button_pressed}
if the button_pressed is equal to "All Browsers" then
display dialog "Enter the URL to go to:" default answer "http://" buttons {"Choose Local File", "Cancel", "OK"} default button 3
copy the result as list to {the empty_var, the button_pressed}
if the button_pressed is equal to "OK" then
copy the result as list to {the goto_URL}
tell application "Finder"
launch application "Safari"
launch application "Camino"
launch application "OmniWeb"
launch application "iCab"
launch application "Internet Explorer"
launch application "Netscape"
launch application "Mozilla"
wait
end tell
tell application "Safari"
activate
make new document at beginning of documents
open location goto_URL
end tell
tell application "Camino"
activate
make new document at beginning of documents
open location goto_URL
end tell
tell application "OmniWeb"
activate
make new document at beginning of documents
GetURL goto_URL
end tell
tell application "iCab"
Activate
make new window
OpenURL goto_URL
end tell
tell application "Internet Explorer"
Activate
GetURL goto_URL
end tell
tell application "Netscape"
activate
Get URL goto_URL
end tell
tell application "Mozilla"
activate
Get URL goto_URL
end tell
else if the button_pressed is equal to "Choose Local File" then
set the local_file to choose file with prompt "Choose a local file to open:"
tell application "Finder"
launch application "Safari"
launch application "Camino"
launch application "OmniWeb"
launch application "iCab"
launch application "Internet Explorer"
launch application "Netscape"
launch application "Mozilla"
end tell
tell application "Safari"
activate
make new document at beginning of documents
open local_file
end tell
tell application "Camino"
activate
make new document at beginning of documents
open local_file
end tell
tell application "OmniWeb"
activate
make new document at beginning of documents
open local_file
end tell
tell application "iCab"
Activate
make new window
ShowFile local_file
end tell
tell application "Internet Explorer"
Activate
open local_file
end tell
tell application "Netscape"
activate
open local_file
end tell
tell application "Mozilla"
activate
open local_file
end tell
end if
else if the button_pressed is equal to "Just Safari" then
display dialog "Enter the URL to go to:" default answer "http://" buttons {"Choose Local File", "Cancel", "OK"} default button 3
copy the result as list to {the empty_var, the button_pressed}
if the button_pressed is equal to "OK" then
copy the result as list to {the goto_URL}
tell application "Safari"
activate
make new document at beginning of documents
open location goto_URL
end tell
else if the button_pressed is equal to "Choose Local File" then
set the local_file to choose file with prompt "Choose a local file to open:"
tell application "Safari"
activate
make new document at beginning of documents
open local_file
end tell
end if
end if
Really though, I haven't done AppleScript for so long, it was kinda cool to get back to it! Oh, and I know that all those browser actions work on their own, but the IE, Netscape, and Mozilla ones don't work with all those others in front of them. What you'll need to do is take out the ones you don't need (iCab, Omniweb, etc.) and just leave the others. You can also change the 'Default' browser. I assume you know a little Applescript, so I won't describe how to do it unless you need me to
__________________ < Also Known As aeromusek in places > < PowerBook | 1.67GHz | 1024MB RAM | 120GB | 17" High Res > < iPod | 20GB | 3rd gen > "the show must go on" - the artists of the world |
|
#11
| |||
| |||
| No, No All you have to do is say: open location "http://www.youtube.com/watch?v=QFCSXr6qnv4&feature=user" Or something along those lines. |
![]() |
| Bookmarks |
| Thread Tools | |
|
|