FinderPop 2.4 Suggestions & Bug Reports[Up to topic list]  [Home]

Who What
billearl
20 Sep 2011, 04:54
FinderPop 2.4 Suggestions & Bug Reports
Hi, Turly. Thanks for FinderPop 2.4. It's amazingly useful. Here are a few findings to consider for an update.
If any of my suggestions are already implemented and I just missed that, please let me know.

Suggestions (maybe this should be in the Wish List forum):
1. An option to add FinderPop items to the bottom of the contextual menu instead of the top.
2. For folders in the FinderPop Items folder, an option to only allow items contained in those folders to be opened, not the folders themselves.
3. An option to not display any icons (neither generic or custom) in the contextual menu.

Possible Bugs:
1. The "Squeeze Menus" checkbox does not appear to have any effect.
2. The tooltip text for the "Aliases in Italic" is incorrect.
billearl
24 Sep 2011, 04:12
Re: FinderPop 2.4 Suggestions & Bug Reports
I must say, I love this feature: "If you select a Unix shell script file (for now, files whose name ends in '.sh') the script will be executed. Any Finder selection is passed to the script as standard text arguments." I've been looking for this behaviour for years. Great for operating on selected files in the Finder, such as copy path, make symlink, hide-show file extension, open with, etc. Works perfectly, just like native contextual commands like Get Info, Make Alias, etc.

I've been using AppleScript (e.g. Services) for this sort of thing, but Finder icons had to be "blue" selected (which often required a left click to activate the Finder window containing the files before the right click) rather than "gray" selected (one right click from anywhere).

BTW, this is why I requested an option to not display icons. Icons are kind of meaningless for commands like these.

EDIT: It turns out that Services do this correctly if the AppleScripts are written correctly :oops: , but not previous methods I tried. However, FinderPop is vastly superior to Services for organizing contextual menus.
turly
24 Sep 2011, 07:12
Re: FinderPop 2.4 Suggestions & Bug Reports
If you've got useful shell scripts, feel free to post 'em!

BTW - append '---x' (that's minus-minus-minus-x) to your extension and no icon will be displayed. It's in the manual somewhere :)
I.e. foo.sh---x will display in FinderPop menus as "foo.sh" but with no icon.
I'm not @ my Mac right now but I think "foo---x.sh" will work as well, which has the advantage of keeping the extension the same.
A bit clunky like most of FinderPop setup - but it works.

That feature has been there since 1997 back when it cost CPU time to display icons in menus :)
billearl
24 Sep 2011, 19:43
Re: FinderPop 2.4 Suggestions & Bug Reports
turly wrote:If you've got useful shell scripts, feel free to post 'em!

I'm really weak in shell scripts, and stronger in AppleScript, so my commands are in an AppleScript script (at ~/Documents/Scripts/FinderPop CMMs.scpt):
Code:
-- called from FinderPop Items shell scripts: "HFS", "POSIX", "Make Alias on Desktop", "Make Symlink",
--        "Hide-Show File Extension", "Mod Date > Creation Date", "Script Debugger", "FileXaminer"
-- NB: This script will not function properly if the selection path contains a plain apostrophe ('),
--        because it is a special character in shell scripting. A curly single quote (’) is okay.

on run {selectedItems, action} -- in selectedItems, folder paths (POSIX) do not end with "/"
   set hfsList to {}
   repeat with i from 1 to (count of paragraphs in selectedItems)
      set end of hfsList to POSIX file (paragraph i of selectedItems) as alias
   end repeat
   
   if action is in {"hfsPath", "posixPath"} then
      set s to ""
      repeat with eachItem in hfsList -- an alias list, so folder paths will end with ":" or "/"
         if action is "posixPath" then set eachItem to POSIX path of (eachItem as text)
         set s to s & (eachItem as text) & return
      end repeat
      set the clipboard to text 1 thru -2 of s
   else if action is "makeAlias" then
      tell application "Finder" to make alias at (path to desktop folder) to every item in hfsList
   else if action is "makeSym" then
      repeat with eachItem in (paragraphs of selectedItems) as list
         do shell script "ln -s " & quoted form of eachItem & " " & quoted form of (eachItem & ".sym")
      end repeat
   else if action is "hideShow" then
      tell application "Finder" to repeat with eachItem in hfsList
         set extension hidden of eachItem to not (extension hidden of eachItem)
      end repeat
   else if action is "modDate" then
      tell application "Finder" to repeat with eachItem in hfsList
         set modification date of eachItem to creation date of eachItem
      end repeat
   else if action is in {"com.latenightsw.ScriptDebugger", "com.gideonsoftworks.filexaminer"} then
      tell application "Finder" to open every item in hfsList using application file id action
   end if
end run

In my FinderPop Items folder, HFS and POSIX are in "Copy Path..." sub-folder, and Script Debugger and FileXaminer are in "Open With..." sub-folder. A typical shell script in my FinderPop Items folder:
Code:
#!/bin/sh

IFS="
"
osascript ~/Documents/Scripts/FinderPop CMMs.scpt "$*" hfsPath &

An alternative way to do "Make Symlink" via shell script only (thanks to Turly's sample shell script):
Code:
#!/bin/sh

while [ $# -gt 0 ]; do
    ln -s "$1" "$1".sym
   shift
done

A better way to do "Open With..." is to use FinderPop's built-in method instead of the above method. The "Open With..." folder in my FinderPop Items folder now contains application alias files (e.g. Script Debugger, FileXaminer). From the manual, "If there is a Finder selection and you've chosen an application from the FinderPop menu, FP will ask the app you chose from the menu to open the Finder selection."

turly wrote:BTW - append '---x' (that's minus-minus-minus-x) to your extension and no icon will be displayed. It's in the manual somewhere :)

Thanks. Yes, I should have read the manual more carefully :oops: . That works great for files, but for folders, it kills the submenu as well as the icon, so I have to leave the folder icons in.
billearl
08 Oct 2011, 21:56
Re: FinderPop 2.4 Suggestions & Bug Reports
Now that FinderPop 2.4.1 allows it, here is the all-AppleScript version.

The main AppleScript script at ~/Documents/Scripts/FinderPop CMMs.scpt:
Code:
-- called from FinderPop Items AppleScript scripts: "HFS", "POSIX", "Make Alias on Desktop", "Make Symlink",
--        "Hide-Show File Extension", "Mod Date > Creation Date"
-- NB: The selection path must not contain a plain apostrophe ('). A curly single quote (’) is okay.

on run {selectedItems, action} -- in selectedItems, folder paths (POSIX) do not end with "/"
   set aliasList to {}
   repeat with eachItem in selectedItems
      set end of aliasList to POSIX file eachItem as alias
   end repeat
   
   if action is in {"hfsPath", "posixPath"} then
      set s to ""
      repeat with eachItem in aliasList -- an alias list, so folder paths will end with ":" or "/"
         if action is "posixPath" then set eachItem to POSIX path of (eachItem as text)
         set s to s & (eachItem as text) & return
      end repeat
      set the clipboard to text 1 thru -2 of s
   else if action is "makeAlias" then
      tell application "Finder" to make alias at (path to desktop folder) to every item in aliasList
   else if action is "makeSym" then
      repeat with eachItem in selectedItems
         do shell script "ln -s " & quoted form of eachItem & " " & quoted form of (eachItem & ".sym")
      end repeat
   else if action is in {"hideShow", "modDate"} then
      tell application "Finder" to repeat with eachItem in aliasList
         if action is "hideShow" then set extension hidden of eachItem to not (extension hidden of eachItem)
         if action is "modDate" then set modification date of eachItem to creation date of eachItem
      end repeat
   end if
end run

In my FinderPop Items folder, HFS and POSIX are in a "Copy Path..." sub-folder.
A typical AppleScript script (HFS.scpt in this example) in my FinderPop Items folder:
Code:
on run selectedItems
   run script file ((path to documents folder as text) & "Scripts:FinderPop CMMs.scpt") with parameters {selectedItems, "hfsPath"}
end run

For "Open With..." items, I now use FinderPop's built-in method as described in my previous post.