Page 1 of 1

Send multiple files with <curitem> ?

Posted: 27 Sep 2012 17:02
by kunkel321
Hi All,
I've made myself a User-Defined Command to launch ReNamer
http://www.den4b.com/?x=products (free)
According to the ReNamer wiki, there are some command lines for feeding files to it.
http://www.den4b.com/wiki/ReNamer:Command_Line

It seems like "C:\Program Files\ReNamer\ReNamer.exe" /files "<curitem>" is the way to go...
It does open ReNamer with one file (or one folder full, if the folder was the single item selected).

If it's possible, I'd like to set it up so I can select multiple items in the same window(folder) and send them all to ReNamer. Presumably I would need to send multiple items to <curitem>.

Is there a workaround for this? Thanks for any ideas...

Re: Send multiple files with <curitem> ?

Posted: 27 Sep 2012 17:05
by serendipity
kunkel321 wrote:Hi All,
I've made myself a User-Defined Command to launch ReNamer
http://www.den4b.com/?x=products (free)
According to the ReNamer wiki, there are some command lines for feeding files to it.
http://www.den4b.com/wiki/ReNamer:Command_Line

It seems like "C:\Program Files\ReNamer\ReNamer.exe" /files "<curitem>" is the way to go...
It does open ReNamer with one file (or one folder full, if the folder was the single item selected).

If it's possible, I'd like to set it up so I can select multiple items in the same window(folder) and send them all to ReNamer. Presumably I would need to send multiple items to <curitem>.

Is there a workaround for this? Thanks for any ideas...
Example from help file:

Code: Select all

openwith """D:\Program Files\WinZip\Winzip32"" -e <items> ""<base>""", m;

Re: Send multiple files with <curitem> ?

Posted: 27 Sep 2012 21:32
by Stefan

Code: Select all

::run """X:\Tools\ReNamer\ReNamer.exe"" <curpath>";   //current folder name itself 

::run """X:\Tools\ReNamer\ReNamer.exe"" <selitems>";  //rename the items currently selected

::run """X:\Tools\ReNamer\ReNamer.exe"" *.<curext>"; //all files from same type as the currently selected file type

You can even automate this some more if you like:

Code: Select all


//// === Path to ReNamer.exe + .ini
   $ReNamerPath = "X:\Tools\ReNamer";


//// === Read the ReNamer.ini
    //getkey(key, section, [INIfile], [flags])
	/*
	[Filters]
	AddFilesFromFolders=1
	AddFoldersAsFiles=1
	IncludeSubfolders=1
	*/
   $AddFoldersAsFiles = getkey( "AddFoldersAsFiles", "Filters", "$ReNamerPath\ReNamer.ini");


//// === Do some preparations to prompt the user:
   if ($AddFoldersAsFiles==1){
        $AddFoldersAsFiles="On"; $opposition="Off";
   }else{
        $AddFoldersAsFiles="Off"; $opposition="On";
   }

//// === prompt the user:
   $Change = confirm( "ReNamer AddFoldersAsFiles is set to '$AddFoldersAsFiles'   <crlf 3>
               Do you want to turn it '$opposition' ?");


//// === If user has OK'ed:
    if ($Change){
       if($opposition=="On"){$opposition=1;}else{$opposition=0;}
          //setkey value, key, section, [INIfile], [flags]
          setkey $opposition, "AddFoldersAsFiles", "Filters", "$ReNamerPath\ReNamer.ini";
    }
    //msg "Re-check: " . getkey( "AddFoldersAsFiles", "Filters", "$ReNamerPath\ReNamer.ini");


//// === However, run ReNamer
   run """$ReNamerPath\ReNamer.exe"" <curpath>"; //with the above made settings.

Or even better

Code: Select all

   //inputselect(header, listdata, [separator=|], [style=1], [cancel], [width=600], [height=400], [windowcaption])
     $listdata = "AddFilesFromFolders|AddFoldersAsFiles|IncludeSubfolders";
     $ReNamerSettings = inputselect(ReNamer Settings, $listdata,,2);
     msg "Use SetKey() to write this settings: $ReNamerSettings";

/*
          <- some more code needed here ->
          
          //setkey value, key, section, [INIfile], [flags]
          setkey value, "AddFilesFromFolders", "Filters", "$ReNamerPath\ReNamer.ini";
          setkey value, "AddFoldersAsFiles"   , "Filters", "$ReNamerPath\ReNamer.ini";
          setkey value, "IncludeSubfolders"   , "Filters", "$ReNamerPath\ReNamer.ini";
*/

Re: Send multiple files with <curitem> ?

Posted: 27 Sep 2012 22:40
by kunkel321
Wow! Thanks so much.

It'll take me a while to fully digest this.
I did get one of the top (one-liner) ones to work. I've been pretty intimidated by the thought of scripting... but that wasn't too painful :)