• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Paths & quoted form & do shell script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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 02:01:24 -0700
  • Thread-topic: Paths & quoted form & do shell script

On 10/9/05 1:51 AM, "Martin Orpen" <email@hidden> wrote:

> on 9/10/05 02:39, Mark J. Reed at email@hidden wrote:
>
>> Well, this script works for me:
>>
>> set thePath to "/Users/martinorpen/Documents/Photoshop Edit Log.txt"
>> do shell script "/usr/bin/grep -i saved " & quoted form of thePath
>>
>> Maybe the path in the text file is weird?  It doesn't include quote
>> marks in the file, does it?
>
> They are identical to the human eye, identical in class, but not identical
> to AS:
>
>     set theFlag to false
>     set tFile to (path to temporary items as string) & "PSLogTest.txt"
>     set thePath to paragraph 1 of (read file tFile)
>     log thePath
>     set otherPath to "/Users/martinorpen/Documents/Photoshop Edit Log.txt"
>     log otherPath
>     if thePath is equal to otherPath then
>         set theFlag to true
>     end if
>     log theFlag
>
> What I see in the Event Log is:
>
>     (*/Users/martinorpen/Documents/Photoshop Edit Log.txt*)
>     (*/Users/martinorpen/Documents/Photoshop Edit Log.txt*)
>     (*false*)
>
>
> But, I've just realised that the strings aren't identical to Entourage
> either - look what I get when I paste:
>
>  (*/Users/martinorpen/Documents/Photoshop Edit Log.txt*)
>     (*/Users/martinorpen/Documents/Photoshop Edit Log.txt*)
>     (*false*)
>
> Or Text Edit:
>
>     (**)
>     (*/Users/martinorpen/Documents/Photoshop Edit Log.txt*)
>     (*false*)
>
> What the bloody hell is going on?
>
> (The original text file was written using "open file for access/write to
> file/close file")

I suggest you ask for the class of each path. Also try reading the file as
Unicode text, then compare.

--
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

  • Follow-Ups:
    • Re: Paths & quoted form & do shell script
      • From: Martin Orpen <email@hidden>
References: 
 >Re: Paths & quoted form & do shell script (From: Martin Orpen <email@hidden>)

  • Prev by Date: Re: Paths & quoted form & do shell script
  • Next by Date: Re: Coercing alias with foreign characters to Unicode text
  • Previous by thread: Re: Paths & quoted form & do shell script
  • Next by thread: Re: Paths & quoted form & do shell script
  • Index(es):
    • Date
    • Thread