Re: Internet Shortcut _ Urgent
Re: Internet Shortcut _ Urgent
- Subject: Re: Internet Shortcut _ Urgent
- From: Sander Tekelenburg <email@hidden>
- Date: Fri, 12 Apr 2002 17:42:49 +0200
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
At 09:21 -0500 UTC, on 12-04-2002, Queen Ann wrote:
>
Hi ,
>
>
I have one more doubt in the Internet Shortcut.
>
Does the solution depend on the version of Mac OS?
>
>
tell application "Finder"
>
set thePathToTheDesktop to path to the desktop
>
set theFile to (thePathToTheDesktop & "theurl.url") as text
>
try
>
close access file theFile
>
end try
>
open for access file theFile with write permission
>
write "[InternetShortcut]
>
URL=http://www.yahoo.com/
>
" to file theFile
>
close access file theFile
>
set the file type of file theFile to "LINK"
>
set the creator type of file theFile to "MSIE"
>
end tell
>
>
In fact, I had modified the above code a bit because the browser was not
>
recognising the URL in the shortcut because there was no "carriage return"
>
and "formfeed".
>
So I modified the write statement as follows:
>
" write "[InternetShortcut]" & return & (ASCII character 10) &
>
"URL=http://www.yahoo.com"
>
>
It works fine on my Mac 9 machine. But it doesnt work on my colleague's
>
machine.
Define "doesn't work" ;) Does the script err? Does it crash? Does it not
create the file? Does the resulting file not do what was intended?
It might be important to note that the resulting file does not seem to be a
'real' Internet Location file, but something specific to Explorer. When I
create such a file from Opera or iCab, its file and creator types are "ilht"
and "drag".
When I change your script to use those file and creator types,
double-clicking the thusly created file results in the Finder asking me in
which application I want it opened.
Also noteworthy is that those Internet Location files, as created by Opera
and iCab, seem to contain the data in the resource fork. So possibly what you
need to do to create such files is use a third-party Scripting Addition, like
Tanaka's, that allows you to create/edit resource files.
>
I donno what version of Mac OS he has.
It might pay to find out ;) (In any case, Internet Location files were
introduced in Mac OS 8.0, or 8.5. They won't work under Mac OS 7.x.)
-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <
http://www.pgp.com>
iQA/AwUBPLcAc+sywKfXgqKdEQLeuwCgyRES14Aq+XGKc4Ldtycnp/SdN9wAn3k9
P1UqOyVGvD+YbsanzycLb4ve
=D0bx
-----END PGP SIGNATURE-----
--
Sander Tekelenburg, <
http://www.euronet.nl/~tekelenb/>
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.