Re: Universal or general path to desktop?
Re: Universal or general path to desktop?
- Subject: Re: Universal or general path to desktop?
- From: MR <email@hidden>
- Date: Tue, 8 Apr 2003 10:30:53 -0800
Thanks to Paul, Michael and Christopher for straightening me out on
this. Like I said when I joined this list a month ago I was new to
Applescript, using it by necessity within Filemaker. Sometimes it is
confusing what the experts on this list mean as code and what they mean
by variables or explanation. I confused the ((path to desktop folder as
string)) as an indication to put the path to the folder on the desktop
in place of that! Of course my face is red after learning what it
meant. I apologize for questioning the experts here.
Within Applescript a compiled script has different colors, fonts and
font styles to indicate what is what but on this list it is difficult
to show those differences.
Now a question - What is the difference between "as string" and "as
text"? They both seem to accomplish the same thing but I sense there
may be a subtle difference.
Thanks again for all the help!
Mike
On Tuesday, April 8, 2003, at 08:21 AM,
email@hidden wrote:
Well, that's _precisely_ why it will work. Isn't that what you wanted?
" I
need it to work on any desktop that has a folder with that name." Any
user
that has folder named "PDFFiles" on the desktop will have:
set folderPath to ((path to desktop as string) & "PDFFiles:")
try
get alias folderPath
on error
display dialog "Squawk"
error number -128 -- quit
end try
-- do other stuff
Naturally you must include the first line just as it is so it will
resolve
to the desktop and folder of whoever is running the script. If you're
going
to be using the Finder immediately anyway, you might prefer this
version:
set folderPath to ((path to desktop as string) & "PDFFiles:")
tell application "Finder"
if exists folder folderPath then
--do other stuff
else
activate
display dialog "Squawk"
error number -128 -- quit
end if
end tell
_______________________________________________
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.