• 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: Finder seems to have trouble with POSIX
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Finder seems to have trouble with POSIX


  • Subject: Re: Finder seems to have trouble with POSIX
  • From: Deivy Petrescu via AppleScript-Users <email@hidden>
  • Date: Sat, 6 Aug 2022 13:54:17 -0400


> On Aug 3, 2022, at 23:13, Gil Dawson via AppleScript-Users
> <email@hidden> wrote:
>
> Hi--
>
> I'm using macOS Mojave V10.14.6.
>
> Could someone please help me understand what is happening here?
>
> set F1 to "/Users/gil/Desktop/Temp Test File.pdf"
>
> log "F1=" & F1 --> (*F1=/Users/gil/Desktop/Temp Test File.pdf*)
> log "POSIX file F1=" & POSIX file F1 --> (*POSIX file F1=Internal
> SSD:Users:gil:Desktop:Temp Test File.pdf*)
>
> set PF1 to POSIX file F1
> log "PF1=" & PF1 --> (*PF1=Internal SSD:Users:gil:Desktop:Temp Test File.pdf*)
>
>
> tell application "Finder" to exists file F1 --> false (I expected an error)
> tell application "Finder" to exists POSIX file F1 --> false (I expected
> "true")
> tell application "Finder" to exists (POSIX file F1) --> false  (I expected
> "true")
> tell application "Finder" to exists PF1 --> true (I expected that!)
>
>
> I would have thought that the first of the last four lines would error and
> the last three lines would all return "true".
>
> I'd appreciate help understanding this.
>
> --Gil
>

You had an excellent explanation.
Now if I may, here is a suggestion, use System events instead of Finder.
This would return true:

set F1 to "/Users/gil/Desktop/Temp Test File.pdf
tell application “System Events" to exists file F1 --> true (if the file exists)



Best, be safe, wear mask, get vaccinated and keep social distance.

Deivy Petrescu
email@hidden






 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Finder seems to have trouble with POSIX
      • From: Gil Dawson via AppleScript-Users <email@hidden>
References: 
 >Finder seems to have trouble with POSIX (From: Gil Dawson via AppleScript-Users <email@hidden>)

  • Prev by Date: Re: Finder seems to have trouble with POSIX
  • Next by Date: Re: Finder seems to have trouble with POSIX
  • Previous by thread: Re: Finder seems to have trouble with POSIX
  • Next by thread: Re: Finder seems to have trouble with POSIX
  • Index(es):
    • Date
    • Thread