
copy and paste waves to another datafolder

maru
Hi, can I copy and paste waves to another datafolder in the databrowser?
I konw I can duplicate the waves using Cmd+D but it makes copies of waves in the SAME datafolder.
As I could not find this feature in the Igor documentation, I am trying to make a function to implement this feature using the GetBrowserSelection.
However, GetBrowserSelection only allow me to select one wave. Is there a technique to select multiple waves from the databrowser?
Function CopyPasteWaves(mode) string mode NewDataFolder/O root:Packages NewDataFolder/O root:Packages:CopyPaste String targetpath strswitch(mode) // string switch case "c": // execute if case matches expression targetpath = GetBrowserSelection(0) Print targetpath string deswavepath = "root:Packages:CopyPaste:" + ParseFilePath(3,targetpath,":",0,0) Duplicate/O $targetpath, $deswavepath Print "waves copied" break case "x": // execute if case matches expression Print "waves cutted" break case "p": // execute if case matches expression Print "waves pasted" break endswitch End
something like this?
November 3, 2021 at 03:48 am - Permalink
Note that drag and drop achieves the same as 'cut' and 'paste'.
November 3, 2021 at 04:01 am - Permalink
Also, you will need Igor 9 to access the DataBrowserObjectsPopup menu
November 3, 2021 at 04:04 am - Permalink
Note that you can also achieve something like copy & paste via drag and drop while holding the 'alt' or 'ctrl' key. A small + icon will appear next to the mouse cursor in this case. This works of course with multiple waves selected as well as with folders.
November 3, 2021 at 04:09 am - Permalink
In reply to Note that you can also… by chozo
Option on a mac.
That's a whole lot easier.
November 3, 2021 at 04:16 am - Permalink
Thank you very much. Your code works perfectly. It is far beyond my expectation.
This copy and paste menu should be a native feature for future Igor.
November 4, 2021 at 05:13 am - Permalink