Re: Possible to create URL clipping with script?
Re: Possible to create URL clipping with script?
- Subject: Re: Possible to create URL clipping with script?
- From: "Christopher C. Stone" <email@hidden>
- Date: Wed, 3 Jan 2001 06:42:05 -0600
At 01/02/01 15:55 +0100, Wim Melis wrought:
>
If you select a URL in some text, and drag it to the desktop, it will
>
become a clickable URL bookmark instead of a text clipping. (Don't know
>
the proper English term for them.)
>
>
Is there any way to create those URL clippings with AppleScript?
___________________________________________________________________________
Hello Wim,
This is less than elegant, but it works. It requires the Satimage osax.
http://www.satimage.fr/
The most recent version is only available with the AppleScript Editor SMILE (freeware); an older version is available as a separate download.
Watch the wraps.
set fName to "urlClipping"
set pd to path to desktop folder as string
set urlStr to "
http://www.macintouch.com"
set a0x2 to (ASCII character 0) & (ASCII character 0)
set a0x3 to (ASCII character 0) & (ASCII character 0) & (ASCII character 0)
set a0x7 to a0x3 & a0x3 & (ASCII character 0)
set a0x9 to a0x3 & a0x3 & a0x3
set a1x1 to ASCII character 1
set a2x1 to ASCII character 2
set a4x1 to ASCII character 4
set txt to "TEXT"
set xurl to "url "
set dragStr to a0x3 & a1x1 & a0x3 & a4x1 & a0x7 & a2x1 ,
& txt & a0x2 & a1x1 & a0x9 & xurl & a0x2 & a1x1 & a0x9
tell application "Finder"
set f to make file at desktop with properties {creator type:"drag", file type:"ilht", name:fName}
end tell
set f to f as alias
PutResource urlStr to f type "TEXT" index 256
PutResource urlStr to f type "url " index 256
PutResource dragStr to f type "drag" index 128
tell application "Finder"
duplicate f
delete f
set name of file (pd & fName & " copy") to fName
end tell
Strangely, the created file activates Easy Open when double clicked, but it's duplicate functions fine.
Best Regards,
Christopher Stone
______________________________
StoneWorks Computer Consulting
email@hidden