Re: Getting full path of files...
Re: Getting full path of files...
- Subject: Re: Getting full path of files...
- From: Hans Haesler <email@hidden>
- Date: Fri, 4 May 2001 09:47:43 +0200
On Thu, 03 May 2001, Simeon Johnston wrote:
>
snip>
>
As you can see I already have "file path". Is this the only way to do
>
this? >What else can I do to get the full path of files?
There is nothing else. This is the only way. Just replace 'theImageName'
by 'theImagePath' where it is copied in the text box. But make sure to
coerce 'theImagePath' to text, first.
BTW, your script does too much work. There is no use to set up
'theListOfPictureBoxesWithImages'. I've done some timings a couple of
months ago and I just made some other sessions where I compared
[setting up of a list] and [direct looping through the boxes].
When run from Script Editor the "list technique" is faster. But when
run from OSA Menu the "looping technique" is no longer behind.
The test document has 100 boxes, one is empty. "list" gives an average
of 156 ticks. "loop" shows 155 ticks.
Surprise: when the number of empty boxes is increased to 11, the results
are not as you may expect: "list" = 142, "loop" = 129.
When emptying more boxes, down to a 50:50 ratio, the average of the
timings is more or less equal, but the "loop"'s results are more steady.
Now, on an other machine, with another system and in another environment
someone may get contrary results. Here I use a B&W G3/450, Mac OS 8.6,
file sharing is off, but two volumes of the server are mounted.
Maybe you want to stick with the list. But then you should strip out ...
---
set theListOfPictureBoxesWithImages to the reverse of
theListOfPictureBoxesWithImages
---
... and modify the repeat conditions:
---
repeat with i from count of theListOfPictureBoxesWithImages to 1 by -1
---
Or, perhaps, you would want to give the looping technique a try:
---
tell document 1 of application "QuarkXPress 4.11"
repeat with i from 1 to count of picture boxes
if (bounds of image 1 of picture box i) is not {0, 0, 0, 0} then
if (file path of image 1 of picture box i) is not null then
tell image 1 of picture box i
set imgPath to (get file path) as text
end tell
else
set imgPath to "Pasted PICT"
end if
end if
--
--do your stuff with the file path
--
end repeat
end tell
---
Regards,
Hans
---
Hans Haesler | email@hidden