• 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: fsitem ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: fsitem ?


  • Subject: Re: fsitem ?
  • From: Christopher Stone <email@hidden>
  • Date: Fri, 24 Feb 2017 21:44:08 -0600

On Feb 24, 2017, at 20:07, Jean-Christophe Helary <email@hidden> wrote:
I'm trying Path Finder and Forklift to see if they work better than finder and was surprised to see that neither of them had access to tags. The only thing they could see was the label index of the file.


Hey Jean-Christophe,

Not true.  Use the find-field in the help menu of both apps to search for “tag”.

(I own licenses for both products.)

They both refer to a fsitem, which I guess stands for "file system item". And that fsitem does not seem to have a "tag" property.

ForkLift is not at all scriptable, so I'm not sure where you're getting “They both”.

Path Finder's scriptability is poor to say the least, and indeed it has no access to tags via AppleScript.

Select an item in Path Finder and run this:

tell application "Path Finder"
   set pfSelList to selection
   item 1 of pfSelList
end tell

Open Script Debugger's Result Explorer Window from SD's “Script” menu.

Click on “Best” view and examine the object record.

Compare that with this:

tell application "Finder"
set finderSelectionList to selection
item 1 of finderSelectionList
end tell

The Finder doesn't have access to tags either (nor does System Events).

Does that mean that both applications only rely on what the file system is feeding them without trying to get more of the item metadata ?

It means the developers don't care much about making their app scriptable.

Complain!  I do periodically.

Basically the way to script Path Finder is to get or set the selection and then not rely upon it for anything else.  Use the Finder, the File Manager with ASObjC, or the shell for processing.

--------------------------------------------------------------------------------
# Auth: Christopher Stone
# dCre: 2016/11/16 23:22
# dMod: 2017/02/24 20:59
# Appl: Path Finder
# Task: Return POSIX Paths or FURLs of selected items.
# Libs: None
# Osax: None
# Tags: @Applescript, @Script, @Path_Finder, @POSIX_Paths, @FURL, @Selection
# Test: Path Finder 7.4.1 on macOS 10.12.3
--------------------------------------------------------------------------------

tell application "Path Finder"
   set pfSelList to selection

   

   if pfSelList ≠ missing value then

      

      repeat with theItem in pfSelList

         

         # POSIX Paths:
         # set contents of theItem to (POSIX path of theItem)

         

         # FURLs
         set contents of theItem to (POSIX path of theItem) as «class furl»

         

      end repeat

      

      return pfSelList

      

   else
      error "No Selection was made in Path Finder!"
   end if
end tell

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

Furls play better with the Finder.

--
Take Care,
Chris

 _______________________________________________
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: fsitem ?
      • From: Jean-Christophe Helary <email@hidden>
References: 
 >fsitem ? (From: Jean-Christophe Helary <email@hidden>)

  • Prev by Date: Re: Finder window views ?
  • Next by Date: Re: Replacement for Finder?
  • Previous by thread: Re: fsitem ?
  • Next by thread: Re: fsitem ?
  • Index(es):
    • Date
    • Thread