How to get ("selecteditemsnames") for "basenames" only
Posted: 12 Sep 2012 02:14
Hi there,
I see the get(selecteditems...) command is only for paths and fullnames. What would be the equivalent to return selected items basenames?
Or how would I use get("curitem", "base") in a foreach loop?
Or maybe I'm going about everything the wrong way. I want to create new txt files named after selected item's basenames (obviously to avoid the selected item's extension being included in the txt filename).
I've tried this but it includes the extension in the new name:
And this doesn't include the extension but it only works on the last selected item:
I see the get(selecteditems...) command is only for paths and fullnames. What would be the equivalent to return selected items basenames?
Or how would I use get("curitem", "base") in a foreach loop?
Or maybe I'm going about everything the wrong way. I want to create new txt files named after selected item's basenames (obviously to avoid the selected item's extension being included in the txt filename).
I've tried this but it includes the extension in the new name:
Code: Select all
$lst = get(selecteditemsnames);
foreach($tk, $lst, "<crlf>",) {
copytext "$tk";
new("<clipboard>.txt");
}Code: Select all
$lst = get("curitem", "base");
foreach($tk, $lst, "<crlf>",) {
copytext "$tk";
new("<clipboard>.txt");
}