Add Comment to a File -- Desktop/Finder/PathFinder

Hey Gregory,

You can’t do this directly with Path Finder – however you can get a list of items selected in Path Finder, turn them into aliases, and operate on them using the Finder.

This AppleScript will place the given comment in the Get-Info comment of every selected item in the Finder.

------------------------------------------------------------
set theComment to "Your commentary is unnecessary and irrelevant!"

tell application "Finder"
  set finderSelectionList to selection as alias list
  if length of finderSelectionList = 0 then error "No files were selected in the Finder!"
  
  repeat with i in finderSelectionList
    set comment of i to theComment
  end repeat
  
end tell
------------------------------------------------------------

This AppleScript will place the given comment in the Get-Info comment of every selected item in Path Finder.

------------------------------------------------------------
# Auth: Christopher Stone
# dCre: 2015/12/20 16:10
# dMod: 2015/12/20 16:16 
# Appl: Path Finder & Finder
# Task: Add comments to selected items in Path Finder
# Tags: @Applescript, @Script, @Path_Finder, @Add, @Comments, @Selection
------------------------------------------------------------

set theComment to "Your commentary is unnecessary and irrelevant!"

tell application "Path Finder"
  set pfSelectionList to selection
  if pfSelectionList ≠ missing value then
    repeat with i in pfSelectionList
      set (contents of i) to POSIX path of (contents of i)
    end repeat
  else
    error "Nothing is selected in Path Finder!"
  end if
end tell

repeat with i in pfSelectionList
  set (contents of i) to alias POSIX file (contents of i)
end repeat

tell application "Finder"
  repeat with i in pfSelectionList
    set comment of i to theComment
  end repeat
end tell

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

You can use a Prompt for User Input action to collect the text for the comment.

You can get the text from a Keyboard Maestro variable into AppleScript easily:

https://wiki.keyboardmaestro.com/AppleScript

-Chris