K
Kevin_Cossaboon
Version: 2008
Operating System: Mac OS X 10.5 (Leopard)
Processor: Intel
Email Client: Exchange
I am struggling to write a apple script that will take the highlighted text and open it as a URL in either SAFARI or the default WEB Browser.
I started with the script "Save Selection", but it does not seem to work.
The Line
"set theText to the «class pusl»"
Does not seem to select the text highlighted.
My hope is to fix an issue that Web meetings have the URL in the text of the appointment, but are not a hyper link they are just displayed as plain text http:\\go.here.com
I wanted a script that when I highlighted the text that it would launch SAFARI and go the the URL selected.
Here is my attempt at hacking the "Save Selection...." Script.
-----------------------------------
(*
Save Selection...
Copyright (c) Microsoft Corporation. All rights reserved.
Saves the selection into a text file
* )
on run
set theText to ""
tell current application
activate
try
set theText to the «class pusl»
-- trigger error if no text
if theText is "" then
end if
on error
display dialog ¬
"This script works on text selected in a message." buttons {"OK"}
set theText to ""
end try
end tell
set theText2 to theText as text
try
if theText is not "" then
tell application "Safari"
open location theText
end tell
end if
on error
display dialog "There was an error opening the URL." buttons {"OK"}
end try
end run
Operating System: Mac OS X 10.5 (Leopard)
Processor: Intel
Email Client: Exchange
I am struggling to write a apple script that will take the highlighted text and open it as a URL in either SAFARI or the default WEB Browser.
I started with the script "Save Selection", but it does not seem to work.
The Line
"set theText to the «class pusl»"
Does not seem to select the text highlighted.
My hope is to fix an issue that Web meetings have the URL in the text of the appointment, but are not a hyper link they are just displayed as plain text http:\\go.here.com
I wanted a script that when I highlighted the text that it would launch SAFARI and go the the URL selected.
Here is my attempt at hacking the "Save Selection...." Script.
-----------------------------------
(*
Save Selection...
Copyright (c) Microsoft Corporation. All rights reserved.
Saves the selection into a text file
* )
on run
set theText to ""
tell current application
activate
try
set theText to the «class pusl»
-- trigger error if no text
if theText is "" then
end if
on error
display dialog ¬
"This script works on text selected in a message." buttons {"OK"}
set theText to ""
end try
end tell
set theText2 to theText as text
try
if theText is not "" then
tell application "Safari"
open location theText
end tell
end if
on error
display dialog "There was an error opening the URL." buttons {"OK"}
end try
end run