Re: Paths & quoted form & do shell script
Re: Paths & quoted form & do shell script
- Subject: Re: Paths & quoted form & do shell script
- From: Paul Berkowitz <email@hidden>
- Date: Sun, 09 Oct 2005 10:02:52 -0700
- Thread-topic: Paths & quoted form & do shell script
On 10/9/05 3:51 AM, "Martin Orpen" <email@hidden> wrote:
> on 9/10/05 10:01, Paul Berkowitz at email@hidden wrote:
>
>> I suggest you ask for the class of each path. Also try reading the file as
>> Unicode text, then compare.
>
> They are both "strings".
>
> Reading thePath as Unicode text will set the comparison flag to *true* but
> still causes the same error when you "do shell script".
>
> The problem must be with the original writing of the file. Writing a path as
> string to a file seems to have given me more than I bargained for :-(
I think Matt is probably right about the null characters. There are
interesting coercions in AppleScript that ignore these in some conditions.
What happens if you read as Unicode and then explicitly coerce to string:
set thePath to (paragraph 1 of (read file tFile as Unicode text)) as
string
There might still be a trailing or leading null character hanging bout but
I'd hope that the explicit 'as string' coercion might remove all of them.
>
> If I write the file using the shell by doing:
>
> echo "/path/to/whatever" > /path/to/the/file
>
> The script works as expected and I get what I wanted.
Interesting. How were you writing to the file before?
--
Paul Berkowitz
_______________________________________________
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