RE: Relative path
RE: Relative path
- Subject: RE: Relative path
- From: "Grimm, Kenneth" <email@hidden>
- Date: Tue, 1 Jul 2003 10:13:03 -0400
Justin:
A few sample approaches:
1) Use hard-coded properties.
property filePath1 : alias "Macintosh HD:foldername:filename"
2) Use properties set at first-run.
property filePath1 : ""
if filePath1 = "" then
set filePath1 to choose file with prompt "Where is file 1?"
end if
Once this is asked, it never is presented again as long as the alias
resolves or the script is recompiled.
3) Choose file each run:
set filePath1 to choose file with prompt "Where is file 1?"
And a few more involving script objects, writing pref files, etc.... there
are actually many ways to approach this.
The first two are beneficial in that if the alias fails to resolve, the OS
asks the user where the file is, and then resets itself according to their
response. The script effectively heals itself.
A user-interface problem with this I've encountered is the users get
programmed to answering the other dialog boxes in the script by rote, and
then when presented with the once-in-a-blue-moon dialog to repair a broken
alias, they invariably miss that this is a "special instance" and not a
regularly asked question -- they point to wrong file every single time, and
I get the service call. Of course this is one of the easiest things to fix
I'm presented with, but that's our secret.
I'd love to hear how other have solved this -- a special alert type box? How
do you present to the user that this IS special, and not one of the regular
inputs? Does Apple have an interface guideline about this kind of thing?
The 3rd method bypasses this potential issue, but the bad thing is it asks
each and every time the script is run. If the folders are different each
time, then this is the way to go, but I don't think that is what you were
asking for.
Hope this helps a bit anyway,
Ken Grimm
Prepress Manager
San Angelo Standard-Times
email@hidden
325-659-8357
>
----------
>
From: Justin
>
Sent: Tuesday, July 1, 2003 8:10 AM
>
To: AppleScript Users
>
Subject: Relative path
>
>
Hello. I have a newbie question. I have a series of AppleScripts that
>
tell
>
an application to open several documents. Currently I have the absolute
>
path to these documents in the script (Macintosh HD:foldername:filename)
>
when I'd rather have a relative path so that this is more portable.
>
>
Any suggestions?
>
>
Thanks!!
>
Justin
>
_______________________________________________
>
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.
_______________________________________________
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.