• 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: path of a Finder item
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: path of a Finder item


  • Subject: Re: path of a Finder item
  • From: Shane Stanley <email@hidden>
  • Date: Wed, 22 Mar 2017 22:46:32 +1100

On 22 Mar 2017, at 6:58 pm, Jean-Christophe Helary <email@hidden> wrote:

Is there a more straightforward way to get the posix path of a Finder item (something I'd need to send to the Terminal as an argument):

tell application "Finder"
set projet_path to POSIX path of (selection as alias)
end tell

I'm fine with this, since it works, but it seems a bit convoluted.

It's not really convoluted enough, unless you're happy to have an error when there's more than one item selected. If you want just the first item -- where first might admittedly be a moving target -- you would use something like:

tell application "Finder"
set projet_path to POSIX path of item 1 of (selection as alias list)
end tell


-- 
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>, <latenightsw.com>


 _______________________________________________
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: path of a Finder item
      • From: Jean-Christophe Helary <email@hidden>
References: 
 >path of a Finder item (From: Jean-Christophe Helary <email@hidden>)

  • Prev by Date: path of a Finder item
  • Next by Date: Re: path of a Finder item
  • Previous by thread: path of a Finder item
  • Next by thread: Re: path of a Finder item
  • Index(es):
    • Date
    • Thread