View Single Post
Old 04-24-2014, 12:00 AM  
DayCuts
Senior Member
 
Join Date: Dec 2003
Posts: 421
Default

1. PCRE support in $replace with capturing and replacement of captured groups in newstring if rx: form is used for substring.
Code:
$replace("<string>","<substring|rx: /substring/>","<newstring>")
Rename from "Author - Title of Publication.pdf" to "Title of Publication by Author.pdf"
Code:
{
RNFR %f
RNTO $replacerx(%f, rx: /^(..*)\S\-\S(..*)(\...*)$/, \2 by \1\3)
}
2. Queue command to add selected items to the transfer queue (for use with the already present Compare and potential Select)

3. Select command possibly with &f or similar to reference the results of the last Select or Compare
Code:
Select <string/rx: pattern>, or similar
Example use: recurse and queue matching items from multiple sub-directories. I know this is a simple example that can be done with selective transfer rules, but combining recursion and grouped command with Select and $replace(&f,...) etc opens up a lot more possibilities.
Code:
{
&cd %f
List
Select <*Dr Seuss*> OR Select <rx: ..*\Sby\SDr.?Seuss..*>
Queue
CDUP
}
There are probably other things I could recall thinking of in the past but I feel they are crossing the line between a simple custom command interface and full script-ability support.
DayCuts is offline