marta-file-manager / marta-issues

An issue tracker for Marta File Manager.
https://marta.yanex.org/
347 stars 0 forks source link

Request: cut / paste to move files #321

Open rayshan opened 6 years ago

rayshan commented 6 years ago

Hello, thanks for your work on Marta. So far so good.

A lot of users coming from the Windows world are used to the pattern of copy / cut files, move to destination, then paste to copy and move files. May we have keyboard bindings for these actions, similar to what's in Finder?

yanex commented 6 years ago

Cmd+C/Cmd+V are already supported. Are you about the "cut" operation (Cmd+X)?

rayshan commented 6 years ago

You're right, Cmd+C/Cmd+V works. Yes cut operation defaulting to Cmd+X would make it complete.

ghost commented 6 years ago

In Finder it's CMD+C and then CMD+ALT+V so you do not have to decide if you want to copy or cut at the first step, it's only different at the second step, while pasting.

rayshan commented 6 years ago

@monouser7dig you're right, although I find this strange considering how cut / paste typically work. I'll remove "finder-like" from this issue.

janvr-at-q16 commented 5 years ago

I would love to have this as well!

ww7 commented 4 years ago

I'm also miss this simple routine feature

matusd2 commented 4 years ago

Hello, I really miss this feature! Do you plan to implement it?

Either Cmd+C > Cmd+Opt+V (like in Finder) or Cmd+X > Cmd+V.

notDavid commented 2 years ago

+1 vote for "Cmd+C and Cmd+Opt+V (like in Finder)".

Seems like a basic feature, and the current solution is somewhat cumbersome. I would like to suggest / be grateful if this would get a high priority :-)

chrisgrieser commented 2 years ago

I fully agree with the others. I am amazed that Marta can do a lot of pretty advanced stuff already out of the box, but moving a single file without the other pane seems a bit cumbersome.

Poitubaren commented 1 year ago

Hi, is there any update on this?

sleepymalc commented 9 months ago

@yanex Would like to get any update on this. This is still one of the most pain point I have when using Marta as my daily file manager.

manuelfitz commented 1 month ago

@sleepymalc @Poitubaren @chrisgrieser @notDavid @matusd2 @ww7 @janvr-at-q16 @rayshan

Hi guys, if you still look for a solution to this.

I wasted my day to find a solution for this. Here's how you can make pasting with Command+Option+V work:

  1. Create AppleScript Store the following AppleScript somewhere as .scpt file, i stored it at ~/Documents/AppleScripts with the name "move_to_folder.scpt" move_to_folder.txt Note: The file looks really strange when opening it in Text Editor as .txt file. After renaming in to .scpt it should open in Script Editor without any problems.

  2. Adapt Marta Preferences Create a gadget in the Marta preferences where you reference the created script. Adapt the first parameter of args as needed to reference the script from above.

gadgets [
    {
        id "gadget.copy.move_files"
        name "My Executable Runner"
        type "executable"

        executable "/usr/bin/osascript"
        args ["/Users/**<USER>**/Documents/AppleScripts/**move_to_folder.scpt**" "${active.folder.path}"]
        workingDirectory "${user.home}"
    }
]

Assign a keyBindings in preferences:

keyBindings {
    "Cmd+Opt+V" "gadget.copy.move_files"
}
  1. Check if it works

How it works

  1. The script checks if parameter1 is a valid folder (the path from marta received with the ${active.folder.path} from the gadget as argument)
  2. The script checks if files / folders are currently copied in the clipboard.
  3. The script accesses the files copied to clipboard and their full paths
  4. The script moves the files to the folder one by one by using shell script mv -n command. The -n argument is used to only move files which don't exist at the target. You can remove the -n if you want it to replace automatically.

Further Adaptions The script could also be adapted to ask if the files should be replaced and to show a status how many files were replaced and question dialogs can be implemented with display dialog in the Apple Script. I didn't need this functionality. And it was already a pain to get this working.

Issues I had I wanted to create a more advanced Plugin for Marta, but calling this Apple Script from a Marta Lua Plugin did result in taking forever to execute because querying the Clipboard to get the files / check if files are copied in the Apple Script takes almost half a Minute. I guess that this is some protection mechanism of Mac? Made some tests but could not find a working solution for that.

I used Lua Rocks for that, and I didn't find a way to directly interact with the Clipboard with Lua. That's why I went the AppleScript route. It's probably possible to implement the functionality with Objective C / Swift / whatever, but did not want to waste more time to implement this feature as I already did.

Topics for future If I would have gotten the Marta Plugin to work with this behavior I would have implemented the functionality to Cut files with Command+X and move the files with Command+V. But I think I won't put any more resources into this functionality. Unfortunately the things possible with the API currently did not support what I needed for this functionality. It's sad to see that there are not that much updates for Marta anymore. It's the best File Manager out there and only lacking some basic functionality.