Re: How to?!
Re: How to?!
- Subject: Re: How to?!
- From: Mr Tea <email@hidden>
- Date: Tue, 24 Sep 2002 00:35:00 +0100
This from Joseph Silverman - dated 23-9-02 08.43 pm:
>
What one-liner script would create an 'internet location file' on the
>
desktop of the currently logged in user.
>
tell finder
>
make new internet location file to "http://localhost:80/" at desktop
>
end finder
Ouch.
The proper syntax for opening and closing this tell block would be:
tell application "Finder"
-- your commands
end tell
If you want to access the current user's desktop, you'll need something like
this:
set usrDesktop to (path to desktop from user domain)
You might also consider writing the URL into a variable at the top of the
script, making it easier to edit, and resulting in shorter, easier to read
lines. So the whole script would be something like:
set theURL to "
http://localhost:80/"
set usrDesktop to (path to desktop from user domain)
tell application "Finder"
make new internet location file to theURL at usrDesktop
end tell
Much of the information required to put together this script is freely
available in the Finder's scripting dictionary, and in the Standard
Additions scripting addition's dictionary, both of which you can read by
opening them in a script editor.
Looking through these dictionaries is not always the most edifying
experience, but it's an essential task if you want to knock up your own
scripts.
Nick
pp Mr Tea
_______________________________________________
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.
References: | |
| >How to?! (From: Joseph Silverman <email@hidden>) |