First, this is a GREAT program. Found it last night. Kicking Winblows explorer to the curb!
Second, I'm trying to write a small script to let me do some automation with some rar files.
Thus far, I can specify a folder and it will extract all of the files in that folder and then delete the archives. Click on the button again and I'm ready to go to the next directory...
So I decided - hey, instead of having to do this for 50 folders * 2 archives in depth, how about clicking on the parent folder and then my button.
Here's what I have:
cd {s}
Find NAME *.(zip|rar|tar|tgz|lha|ace|7z|arj|bz2|gz|lzh|z) IN {sourcepath$} CLEAR RECURSE QUIET
sync:"C:\Program Files\WinRAR\WinRAR.exe" x -y "{f!}" "{sourcepath$}\"
Delete {allfile} QUIET FORCE
Don't laugh. I'm a n00b at this
Anyhow, what I'm trying to do is to iterate through all of the find results but when I use the code above, it opens the find dialog (if I don't use quiet) and doesn't recurse anything.
I think you'll have to do this in two steps. First the find, then run something else on the results.
The Find command will run asynchronously and I don't think there is any way to make the rest of the command wait until the Find completes.
(Your button also does not select anything so the {f!} on the 3rd line won't have any files to work on.)
If you want to run commands on Find results you'll need to output them to a collection. The line below will do that. (I've simplified it to search for *.zip just to make the line shorter.)
Find NAME *.zip IN {sourcepath$} CLEAR RECURSE QUIET COLLNAME "Find Results" SHOWRESULTS=source
Note the COLLNAME and SHOWRESULTS arguments which make the results appear in a collection in the current window.
You could then have a second button which does a Select All and then runs whatever else you want on it (e.g. WinRAR, then a Delete).
One problem I see is that you want the archives extracted to the directory that the Find was started from, which could be difficult. When you're viewing the Find Results collection, any button which uses {sourcepath$} will refer to the collection itself, which isn't where you want to extract files to.
You can extract each archive to a hardcoded directory, of course. Or you could extract each archive to a path relative to the archive's path. There's no good way for the second button to know where the first button was started from, though, unless you somehow save that information and reload it (which is a pain to do).