• 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 "duplicate" requirements
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Finder "duplicate" requirements


  • Subject: Re: Finder "duplicate" requirements
  • From: Christopher Stone <email@hidden>
  • Date: Sun, 28 Jun 2015 03:27:08 -0500

On Jun 28, 2015, at 02:14, Shane Stanley <email@hidden> wrote:
It's a common problem in Xcode-based apps, but I haven't noticed it in standard AppleScript before.
______________________________________________________________________

Hey Shane,

You mean in the Finder?

We've discussed this before, but it's been awhile.

This is on OSX 10.9.5.

The finicky nature of what can coerce where is why I still stick to HFS-Paths and Aliases wherever possible.

--
Take Care,
Chris

-------------------------------------------------------------------------------------------

tell application "System Events" to set posixPath to POSIX path of disk item "~/test_directory/test"

tell application "Finder"

  

  exists POSIX file "/Users/chris/test_directory/test"
  --> true

  

  exists POSIX file posixPath
  --> false

  

  exists alias posixPath
  --> false

  

  exists posixPath as «class furl» as alias
  --> true

  

  exists posixPath as «class furl»
  --> true

  

  exists file posixPath
  --> false

  

  exists (get POSIX file "/Users/chris/test_directory/test")
  --> true

  

  exists posixPath as POSIX file
  --> true

  

  exists (get POSIX file posixPath)
  --> Finder got an error: Can’t get POSIX file "/Users/chris/test_directory/test".

  

end tell

-------------------------------------------------------------------------------------------

tell application "System Events"
  set posixPath to POSIX path of disk item "~/test_directory/test"

  

  exists POSIX file "/Users/chris/test_directory/test"
  --> true

  

  exists (get POSIX file "/Users/chris/test_directory/test")
  --> true

  

  exists alias posixPath
  --> true

  

  exists file posixPath
  --> true

  

  exists posixPath as POSIX file
  --> true

  

  exists POSIX file posixPath
  --> System Events got an error: Can’t get POSIX file "/Users/chris/test_directory/test".

  

  exists (get POSIX file posixPath)
  --> System Events got an error: Can’t get POSIX file "/Users/chris/test_directory/test".

  

end tell

-------------------------------------------------------------------------------------------

 _______________________________________________
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 "duplicate" requirements
      • From: Deivy Petrescu <email@hidden>
    • Re: Finder "duplicate" requirements
      • From: Shane Stanley <email@hidden>
References: 
 >Finder "duplicate" requirements (From: Jean-Christophe Helary <email@hidden>)
 >Re: Finder "duplicate" requirements (From: Shane Stanley <email@hidden>)

  • Prev by Date: Re: Finder "duplicate" requirements
  • Next by Date: Re: Finder "duplicate" requirements
  • Previous by thread: Re: Finder "duplicate" requirements
  • Next by thread: Re: Finder "duplicate" requirements
  • Index(es):
    • Date
    • Thread