Version 5 of Touch is available for download.
touch.js.txt (25.7 KB)
There are several ways of installing a script. Perhaps the most straightforward is to navigate to the Script Add-ins folder using the built-in alias /scripts and then drag and drop your script code (in this case touch.js.txt). Alternatively you can:
- Settings --> Preferences
- Type Scripts into the Search Preferences field to bring up the Scripts window
- Drag and drop your script code (in this case touch.js.txt) into the Scripts window
- Click OK to close
Script Add-ins are described in some detail here in the help file.
To trigger the dialog create a button with the single command Touch, or use Instant Command mode (see here) by typing >Touch.
Touch is intended to perform an action against selected items - e.g. set all timestamps to now, or the same as the oldest or newest item in the list. No timestamps are actually changed until you click the Do It! button and after you have made a change you can choose Set All = Original to revert.
Another use case is to adjust current timestamps up or down. For example, to set all times back by 4 hours you would click the Hours radio button and either click the minus button four times or type 4 in the Adjust By field and click the minus button once. Again, no timestamps are actually changed until you click the Do It! button.
Once an Adjust radio button is clicked, additional options to Increment and Decrement are available in the Touch Action radio button set. These work by sequentially applying an offset to the base (first) item's timestamp. For example, if you select an incremental adjustment by 5 minutes then the second item will be set to the first item plus 5 minutes, the third item will be set to the first item plus 10 minutes, the fourth item will be set to the first item plus 15 minutes, etc.. This capability was requested by @opw62.
Touch v5 supports replacing the current set of selected items with new selections from the associated lister or items whose details have been saved to the clipboard. An easy way to try this is to select a few items and then save to the clipboard with Ctrl-Shift-C then click the Clip button. Now go to the associated lister and select one or more different items and click the Selected button.
Touch v5 can be started from a button or instant command with no options (as described above) or with either FILE or CLIP options. The FILE option is used to populate the dialog with a single file, e.g.
The CLIP option is used to tell touch to ignore selected items and populate the dialog from the clipboard, e.g. Touch CLIP
Touch can also be invoked from a context menu item - e.g. All Files and Folders. If you create a context item you should include a @noprogress directive. See https://resource.dopus.com/t/strange-bug-from-external-script-menu/25410 for why you need this.