I followed the instructions for creating a new menu for creating a new folder with date but could not get it to work. It shows up in right click but does not do anything.
I tried this one in different ways. Nogo. I have no idea why that is. Tried commands, script…nothing. Except if you run it from a terminal. The command is just fine but for some reason it doesn’t start from a servicemenu.
Field codes must not be used inside a quoted argument, the result of field code expansion inside a quoted argument is undefined.
And it looks like %Y is not among the recognized field codes, but %m and %d are and are deprecated. If I run dolphin from console I can see it fail when trying to run this action with:
mkdir: directory »2023–/home/« could not be created
Where “/home/” is what %d expands to in this case and it is apparently tha parent directory of the folder/file you right-click on.
I suggest you make that little script first and point the exec to the script. That will create the date folder in the directory you’re in. However, you can change the script a bit so you can place the folder wherever you want using a kdialog, regardless where the folder was created.
Script:
#!/bin/sh
mkdir $(date +“%d-%m-%Y”) &&
kdemv5 $(date +“%d-%m-%Y”) $(kdialog --getexistingdirectory)
For some reason I could not get it to work. If I right click in Documents folder it is creating a folder in Home and not moving the folder to Documents folder.
Then don’t use it. Without the kdmv part in the script, the folder is created in the directory you’re at. It always is, the kdialog just allows you to move it anywhere you like. Just leave:
#!/bin/sh
mkdir $(date +“%d-%m-%Y”)
Well, then I don’t understand what you would consider perfect. I can create this date folder anywhere on anything. It doesn’t get created in home but in the directory I’m at. And if I want to move it I can always use the kdialog. Not sure what else can be done to make it better.
This is actually not happening with me on Kubuntu. Right click menu creates the date folder in home directory and then the Dialog window opens and I select the folder and it moves the date folder there.
But I can live with that, it is good enough for me.
I placed the script in the same directory, ServiceMenus. No prob whatsoever. Something must be wrong. You’re sure you’re using the right script? Cause from what you say, the command cd’s to ~/ first.