Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Create hyperlinks via AppleScript' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Create hyperlinks via AppleScript
Authored by: DeltaTee on Mar 08, '05 09:16:17AM
Since many people have been having trouble with the «class ktxt» line, wrap the whole thing in a try block:
try
  set hyperlink to «class ktxt» of ((the clipboard as text) as record)
on error
  set hyperlink to (the clipboard as text)
end try
The «class ktxt» line strips all formatting from the clipboard text, but will fail if the text in the clipboard is not styled. This can be useful since some functions cannot handle styled text and there is no way to coerce styled text to standard text.

[ # ]