Re: relative / absolute paths in AS
Re: relative / absolute paths in AS
- Subject: Re: relative / absolute paths in AS
- From: "Marc K. Myers" <email@hidden>
- Date: Mon, 07 Jan 2002 13:09:30 -0500
- Organization: [very little]
>
Date: Sun, 06 Jan 2002 20:49:52 +0100
>
Subject: relative / absolute paths in AS
>
From: kitshy <email@hidden>
>
To: <email@hidden>
>
>
Dear AppleScript users,
>
>
I am a German design student who is writing his final paper.
>
I use AppleScript to present my work on CD-ROM.
>
But I have some problems with it. So I would be very glad if
>
somebody could help me. I have following question:
>
>
I use the software "IconMacher 1.5.4" to generate pictures with
>
icons. after that I use the "clean up"-AppleScript to put the icons
>
in the right order again if I mess up the order by myself.
>
>
this is the "clean up" Script:
>
>
---
>
property myPath : " HOMEBASE :Desktop Folder:test:"
>
>
tell application "Finder"
>
activate
>
set i to 32 --incrementer
>
set s to 10 --left edge of first icon
>
set t to 30 --top edge of first icon
>
set zoomed of container window of folder myPath to true
>
select folder myPath
>
open selection
>
>
select file (myPath & " ")
>
set position of selection to {s + i * 0, t + i * 0}
>
select file (myPath & ")
>
set position of selection to {s + i * 1, t + i * 0}
>
.
>
.
>
.
>
>
set zoomed of container window of folder myPath to true
>
end tell
>
---
>
>
The problem is that this script is only running on my computer
>
because of the path: myPath : " HOMEBASE :Desktop Folder:test:"
>
>
On an other the computer the script does not work if it has a
>
differnt name for the harddisk.
>
>
Is it possible in AppleScript not to give a full path name? Like HTML-Links
>
where you can use a relative path? For example .../desktop/:test:?
>
So it runs on every machine?
Instead of having "myPath" as a property, insert this line before the
Finder tell block:
set myPath to (path to startup disk as text) & "Desktop Folder:test:"
The "path to startup disk as text" will make the path relative to that
machine's startup disk.
Marc K. Myers <email@hidden>
http://AppleScriptsToGo.com
4020 W.220th St.
Fairview Park, OH 44126
(440) 331-1074
[1/7/02 1:09:02 PM]