Dynamic menu to copy template files from folder to current location?

I have a menu in a toolbar. it has a list of buttons that all pretty much run the same command on a file.

One button has

Copy "C:\Users\...\New_File\New Markdown file.md" TO {sourcepath}

And another has

Copy "C:\Users\...\New_File\New PSD file.psd" TO {sourcepath}

Its an excellent way for me to quickly create new files or file templates.
M79RLwlIt3

The issue is I have the same menu in Lister context menu, But each time I add a button to the menu in the toolbar the menu in the context menu does not get updated, so I have to repeat the same thing again. Create the same button for the context menu.

Is there a way to link these two menu menus together? I tried to read on Dynamic menus but found nothing that applies.

Thank you.

1 Like

We'll add something to make this kind of thing easier in the next beta:

The Go FOLDERCONTENT command, which generates toolbar buttons or menu items listing the items below a specified folder, has new modes which copy the clicked files into the current (copytosource), destination (copytodest), left (copytoleft) or right (copytoleft) file displays.

This could be useful if you have a folder containing template items which you frequently need to copy into different folders as you move around. To update the list of template items, you would just need to add or remove things (or softlinks to them) to the folder.

e.g. Go "C:\My Templates" FOLDERCONTENT=copytosource

2 Likes

Great news. I look forward to it then!

That change is in the beta released today: Directory Opus 12.24.1 (Beta)

1 Like

Niiice!
I am gonna install my first beta then.
Thanks.

The new beta lets you copy files from somewhere else to the source like this.

Go "C:\Users\...\New_File\" FOLDERCONTENT=copytosource

But the files creation and modified timpestamps get copied over as well.
I was previously using something like this

Copy COPYFILETIMES=no "C:\Users\...\New_File\Pureref_NewV1.pur" HERE

But adding Copy COPYFILETIMES=no to either at the start or end of:

Go "C:\Users\New_File" FOLDERCONTENT=copytosource

Stops the button from working. Any ideas what I could be doing wrong?

It will use the Preferences / File Operations / Copy Attributes / Preserve the timestamps of copied files setting.

With the Go-FolderContent command, unlike the Copy command, there's no way to override the setting just for one button without changing the global setting.

While that is a solution I really dont have this option right now.
How about after copying using the Go-FolderContent command and the file has been copied over to follow it with a command that setts the created and modified date to now?

This would require the file be selected after the Go-FolderContent command copies it. Something I dont know how to do and was asking about over here.

We'll add a COPYARGS argument to the Go command that lets you include any special arguments you want for the generated copy commands/buttons at the end:

Go "C:\My Templates" FOLDERCONTENT=copytosource COPYARGS COPYFILETIMES=no
2 Likes

New beta is out with this change: Directory Opus 12.24.2 (Beta)

This is a pleasant surprise. Thank you very much Leo and Co.

1 Like