You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have this script (provided by ChatGPT) to place selected files in a folder with a shortcut.
Thing is: it puts the selected files in a new folder - but doesnt let me name the folder.
Maybe someone with the right skills can help out?
Here’s a script for Marta that lets you create a new folder and move selected files into it. You can configure it to be triggered with a shortcut (e.g., Option+Cmd+F). Here's how to set it up:
Save this script, for example, in /path/to/marta/scripts/move_to_new_folder.py.
2. Marta Configuration
Add a New Gadget
Edit your config.marta file to include a gadget for the new functionality:
gadgets [
{
id "gadget.action.move_to_new_folder"
name "Move to New Folder"
type "executable"
executable "/usr/local/bin/python3"
args [
"/path/to/marta/scripts/move_to_new_folder.py"
"${prompt.text 'Enter new folder name:'}"
"${active.selection.paths}"
]
workingDirectory "${active.folder.path}"
}
]
Replace /path/to/marta/scripts/ with the actual path to your script.
Keybinding
Assign the functionality to the Option+Cmd+F shortcut:
Marta will prompt you to enter the name of the new folder.
Enter the folder name, and the files will be moved into the newly created folder.
This script works by prompting the user for the folder name and moving selected files into the new folder within the current directory. The gadgets and keyBindings ensure seamless integration with Marta.
The text was updated successfully, but these errors were encountered:
dmt-hub
changed the title
New Folder with Selection (gadget script)
New Folder with Selection (script)
Dec 22, 2024
Hey! I gave this a try and explored several different ideas. However, as far as I can tell, Marta doesn’t currently support prompting for user input directly through a script. I eventually devised a workaround using Keyboard Maestro alongside a Marta script. It works for me, but it does require KM, and I think it’s always preferable to avoid juggling multiple systems for small functions.
Anyway, here’s my ugly workaround:
Essentially, I trigger a KM macro from Marta that prompts for user input to name the new folder. KM stores the name in a variable, then triggers a Marta macro to create a new folder and move the selected files into it. Finally, KM looks up the new folder and renames it using the stored variable.
I have this script (provided by ChatGPT) to place selected files in a folder with a shortcut.
Thing is: it puts the selected files in a new folder - but doesnt let me name the folder.
Maybe someone with the right skills can help out?
Here’s a script for Marta that lets you create a new folder and move selected files into it. You can configure it to be triggered with a shortcut (e.g., Option+Cmd+F). Here's how to set it up:
1. Python Script:
move_to_new_folder.py
Save this script, for example, in
/path/to/marta/scripts/move_to_new_folder.py
.2. Marta Configuration
Add a New Gadget
Edit your
config.marta
file to include a gadget for the new functionality:Replace
/path/to/marta/scripts/
with the actual path to your script.Keybinding
Assign the functionality to the
Option+Cmd+F
shortcut:3. Usage
Option+Cmd+F
.This script works by prompting the user for the folder name and moving selected files into the new folder within the current directory. The
gadgets
andkeyBindings
ensure seamless integration with Marta.The text was updated successfully, but these errors were encountered: