Re: Internet Shortcut _ Urgent
Re: Internet Shortcut _ Urgent
- Subject: Re: Internet Shortcut _ Urgent
- From: "Queen Ann" <email@hidden>
- Date: Mon, 15 Apr 2002 16:41:20 -0500
- Organization: Tata Infotech
Hi Jay and others,
Thanx a lot for the descriptive answer.
I realised that my colleague's OS version was Mac OS 10.
I just modified the code to prompt the user about where he wants to store the
URL file. ( Previously the code was creating the URL file by itself)
Even when he tried this modified code in Mac 10, it dint work. But when he
tried it in Mas 8.0, it worked fine.
It dint work means that " it gives the error Cant make <class desk> of
Application "Finder" into a item "
I have attach my modified code below . In this code, theres no question of
"theURL.url as text " , right?
I am prompting the user to enter the location where he wants to store the
shortcut.
Does his code depend on the Mac version? Does it have anything specific not to
work on Mac OS 10?
Please help me.
MODIFIED CODE :
-------------------------------------------------------------------------
display dialog "World Book Online-Enter the login id:" default answer ""
set userid to the text returned of the result
display dialog "World Book Online-Enter password:" default answer ""
set passwd to the text returned of the result
set wbol_url to "
http://www.yahoo.com"
tell application "Finder"
set theFilePath to (choose file name with prompt "Enter a name for the
WBOL shortcut")
set theFile to open for access theFilePath with write permission
write "[Internet Shortcut]" & return & (ASCII character 10) & "URL=" &
wbol_url to theFile
close access theFile
set file type of theFilePath to "LINK"
set creator type of theFilePath to "MSIE"
end tell
-----------------------------------------------------------------------------
-------------
Regards,
Ann.
----- Original Message -----
From: Jay Young
To: Queen Ann
Sent: Friday, April 12, 2002 5:23 PM
Subject: Re: Internet Shortcut _ Urgent
>>Hi,
>>Is there a way by which u can read the contents of a URL shortcut file in
Mac
>>He tried it in both IE and Netscape. But he doesnt kno which version of
Mac he was running.
When you ask if there's a way to read the contents of a URL shortcut, are
you speaking about the URL file that you've created on your desktop with the
script? If so, you'll need some sort of word processor to open it. I would
recommend downloading BBEdit Lite if you don't have it. It's a free program
that can open pretty much any text file (not pictures though). I even design
web pages using it!! And it should be able to open these IE files for you too.
You can get a copy at:
http://www.versiontracker.com
Then type BBEdit in the search box at the top (make sure you've selected the
'Mac OS' tab) and then press the 'GO' button. It will bring up different
versions of it. You'll want to get:
BBEdit Lite 6.1.2
Now, if you download BBEdit, here's what you might have to do to open your
IE file. You won't be able to go to File and then Open to open the file.
You'll need to go to BBEdit's folder to where you can see the program's icon
(blue with a 'B' in it). Then drag your IE file on top of that icon and then
let go. This should open the file so you can see it's contents. Let me know if
this doesn't make sense.
To find out the OS version he has, have him click on his desktop to activate
the finder and then go to the Apple Menu item (in the top left corner of the
menu bar) and choose 'About this Computer'. This will give you his Operating
System Information. You can also have him activate Netscape or Internet
Explorer and go to the Apple Menu Item and select 'About Netscape' or 'About
Internet Explorer' to find out which version he's using. You might already
have done this, so I apologize if I'm repeating things.
>>He said when he tried to run the application ( refer in my previous mail)
, it gave an error as follows :
>>Cant make <class desk> of Application "Finder" into a item.
+class desk; is another way that Applescript refers to the desktop. If you
forget to put 'as text' onto the end of the file name like this:
> tell application "Finder"
> set thePathToTheDesktop to path to the desktop
> set theFile to (thePathToTheDesktop & "theurl.url")
Then it can't make the file (theurl.url) into an item. I'm not sure why the
desktop is getting an error. It's quite possible his operating system might be
too old for this AppleScript code. Also, Sander Tekelenburg gave some
excellent information in his email. If your colleague is running OS 7 then
these IE files probably won't work. Let me know what you find out.
Jay
_______________________________________________
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.