Re: Quark place image script woes
Re: Quark place image script woes
- Subject: Re: Quark place image script woes
- From: Nigel Garvey <email@hidden>
- Date: Mon, 23 May 2005 11:05:57 +0100
"Dr Digby L. James" wrote on Mon, 23 May 2005 00:11:09 +0100:
>From your symptoms, it looks as though you may have a text item delimiter
problem.
>set thepath to choose folder with prompt "Choose folder containing TIFFs"
>Following the event log, everything works as expected until the line:
>
> set Path_to_the_image to thepath
>& item i of list_of_items as text
When 'thepath' is an alias and 'item i of list_of_items' is a string, the
result of concatentating them together is a list:
{(an alias), (a string)}
It's this list that's then coerced to text in your last line above.
>Somehow an "s" is added before the filename. So
>it is trying to place sIMG_1429 instead of
>IMG_1429.
If, for some reason, the text item delimiters have become set to "s",
this will be interpolated between the two items when the list is coerced
to text.
>If I replace the line :
>
>set thepath to choose folder with prompt "Choose folder containing TIFFs"
>
>with:
>
>set thepath to "Penny:Documents:Work in Progress
>:Calamy :1727 Volume I:TIFFs:"
>
>(i.e. a real path string) it works.
This supports the hypothesis. When both 'thepath' and 'item i of
list_of_items' are strings, the result of concatenating them together is
simply another string, and the 'as text' is superfluous. Since there's no
list being coerced to string, the state of the text item delimiters isn't
relevant.
The obvious fix would be to ensure that the delimiters are set to ""
before you problem line, but it would actually be more efficient to
coerce the 'choose folder' result to text as soon as you get it:
set thepath to (choose folder with prompt "Choose folder containing
TIFFs") as text
...
set Path_to_the_image to thepath & item i of list_of_items
NG
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden