I'm glad that my little diversion has helped improve your script though (through others' expertise)

Haha, whoops, sorry, that's how I read it.admin wrote:Hmm, "Quick Select", that would have probably a better name than "Flat Select"...
Give these a try:lukescammell wrote:Haha, whoops, sorry, that's how I read it.
I'm struggling with the syntax of the new timestamp scripting and I can't find a full explanation of the various options – I'm obviously looking in the wrong place. Please could you point me in the right direction? I'm trying to figure out how to copy various timestamps into the clipboard.
Thanks
Code: Select all
"Copy Selected Items' Time(s) : copySelTime"
Global $G_ITEMS = Get('SelectedItemsPathNames', '|');
Sub '_copyTime';
"Copy Focus Item's Time(s) : copyFocTime"
Global $G_ITEMS = <focitem>;
Sub '_copyTime';
"-" //--------------------------------------------------------------------------
"Paste Copied Time(s) : pasteTime"
// Prompt user to select time to paste (just assuming clipboard has valid times).
// 4 = Show empty list.
// 32 = Select first item.
// 64 = Focus filter.
$time = InputSelect('Select time to paste', <clipboard>, <crlf>, 4+32+64);
End $time == '', 'No time selected.';
// Prompt user to select fields to modify.
Global $G_FIELDS;
Sub '_fieldPrompt';
End $G_FIELDS == '', 'No fields selected.';
TimeStamp $type, $time;
"Paste Copied Item's Time : pasteItemTime"
// Prompt user to select item to use as source of times (again just assuming clipboard is items).
// 1 = Show icons.
// 4 = Show empty list.
// 32 = Select first item.
// 64 = Focus filter.
$item = InputSelect('Select source item', <clipboard>, <crlf>, 1+4+32+64);
End $item == '', 'No source item selected.';
// Prompt user to select fields to modify.
Global $G_FIELDS;
Sub '_fieldPrompt';
End $G_FIELDS == '', 'No fields selected.';
TimeStamp $G_FIELDS, $item,, '*';
"- : _-" //---------------------------------------------------------------------
"- : _-" //---------------------------------------------------------------------
"Copy Item Time(s)||4 : _copyTime"
Global $G_ITEMS;
End $G_ITEMS == '', 'Global variable G_ITEMS cannot be empty.';
$format = 'yyyy-mm-dd hh:nn:ss';
// Get times.
$list = Report("+{Created $format}|+{Modified $format}|+{Accessed $format}|", $G_ITEMS);
// Sort and remove duplicates.
$list = FormatList($list, 'dents', '|');
// Prompt user to select the times to copy.
// 2 = Show checkboxes.
// 4 = Show empty list.
// 16 = Allow re-ordering items.
// 32 = Select first item.
$list = InputSelect('Select times to copy', $list, '|', 2+4+16+32);
End $list == '', 'Nothing selected to copy.';
CopyText $list,, '|';
"Time Fields to Modify Prompt||4 : _fieldPrompt"
Global $G_FIELDS = '';
// Prompt user to select fields to modify.
// 2 = Show checkboxes.
// 4 = Show empty list.
// 32 = Select first item.
$G_FIELDS = InputSelect('Select fields to modify', '+Created|+Modified|+Accessed', '|', 2+4+32);
// Trim to first characters, remove '|', and lower case.
$G_FIELDS = Recase(Replace(RegexMatches($G_FIELDS, '(?:^|\|).'), '|'), 'lower');
Code: Select all
After copy paste operation...
File Timestamps
----- -------------------
A.rar Preserved
C.txt Preserved
D.pdf Preserved
q.7z A.rar's timestamps
x.wmv C.txt's timestamps
z.dll D.pdf's timestamps
Code: Select all
$sel1 = get("SelectedItemsPathNames", <crlf>, 1);
$sel2 = get("SelectedItemsPathNames", <crlf>, 2);
$cntSel1 = gettoken($sel1, "count", <crlf>);
end (!$sel1 || !$sel2), "No item(s) selected in at least one pane, aborted!";
end ( $cntSel1 != gettoken($sel2, "count", <crlf>)), "Number of selection mismatch, aborted!";
while ($i++ < $cntSel1) { timestamp , gettoken($sel1, $i, <crlf>), gettoken($sel2, $i, <crlf>); }
Thanks for your comment.
Code: Select all
A.rar ---> x.wmv (19.021 KB)
C.txt ---> q.wmv (7.490 KB)
D.pdf ---> z.dll (54 KB)