No announcement yet.

Any way to use lftp as "Open With" ?

  • Filter
  • Time
  • Show
Clear All
new posts

  • Any way to use lftp as "Open With" ?

    I have a local drive on left, SFTP on right.
    I want to use lftp to more quickly download files from right to left.
    Can this be done with a custom 'open with'?

    Currently I have this in Open With:
    /usr/local/bin/lftp s -u user,pass -e "pget -cn50 '%f'";exit
    It gets the correct path on the "right" ... but I need to pass the output (download) folder (left) to the command so that lftp knows where to download to.

    Can this be done? Using the 'working folder' option maybe?

  • #2

    If you click the down arrow dropdown next to the Open With command line definition, we list available variables. %f is the full file name, but would %n (filename) or %F (relative path + file name) work for you in this scenario?
    Aaron P Scooter Software


    • #3
      I'm not clear on how to get the path for the matching LEFT side.

      E.g., If the left path is "/Volumes/media/path/to/folder/" and the right path is "s", and only the RIGHT folder contains file 'xxx' ... what are variables for left path? I.e., the containing folder? Hope this makes sense.

      I think I can use %f1 and %f2 to get left/right full paths, but this only seems to work when there is an item that aligns on both sides.
      Last edited by danzg; 28-Oct-2016, 10:13 AM.


      • #4
        I think I found a way ... a bit clunky ...

        If I manually select the parent FOLDER on the left, and the FILE I want to download on the right, then %f1 gives me the left folder path, and %f2 gives me the right file path.

        So I would add that %f1 as the download folder for the output of lftp...


        • #5
          Ah, I see, and yes. Sorry about that, I didn't understand your request initially. Your current workaround is the best method; we don't supply a path to the 'blank' side if there's no item selected. We have a wishlist entry on this subject, and I'll add your notes, workflow, and workaround.
          Aaron P Scooter Software