How to transform OpenWith into Run?

Discuss and share scripts and script files...
Post Reply
zer0
Posts: 2676
Joined: 19 Jan 2009 20:11

How to transform OpenWith into Run?

Post by zer0 »

Chaps,

I wonder if one kind soul would help me out with this script

Code: Select all

Set($cf,<curfolder>);
   Set($cp,<curpath>);
   Set($nn,<date yyyymmddhhnnss>);
   new "$nn-temp", dir;
   OpenWith("""C:\Program Files (x86)\WinRAR\WinRAR.exe"" e -- *.rar * $nn-temp", "s");
   Msg("Press OK when WinRAR is finished.",1);
   GoTo("<curpath_s>\$nn-temp");
   Sel(a);
   Rename(b,$cf);
   Focus(L);
   MoveTo("..\..");
   #523;
   #523;
   Rename(b,$nn,"$cp");
   SelFilter($nn, d, Name);
   Focus(L);
   delete 1, 0, ;
I would like for the OpenWith line to use Run with an appropriate switch, so that I don't have to prompt (and wait) for the extraction to complete. Thanks a bunch! :D
Reporting a bug? Have a wish? Got a question? Use search - View roadmap - FAQs: Forum + XY site
Windows 7/10
Always using the latest stable two-decimal build

Stefan
Posts: 1360
Joined: 18 Nov 2008 21:47
Location: Europe

Re: How to transform OpenWith into Run?

Post by Stefan »

I don't know if i understood this correct, you mean for one selected archive?

Try if this works:
store the selected archive name into an var and use this $var instead of *.rar

Code: Select all

Set($cf,<curfolder>);
   $curitem = "<curitem>";   //   <================ only selected archive
   Set($cp,<curpath>);
   Set($nn,<date yyyymmddhhnnss>);
   new "$nn-temp", dir;
   //OpenWith("""C:\Program Files (x86)\WinRAR\WinRAR.exe"" e -- *.rar * $nn-temp", "s");
    run """C:\Program Files (x86)\WinRAR\WinRAR.exe"" e -- $curitem * $nn-temp",,1;   //   <===== extract  only selected archive
    //run """C:\Program Files (x86)\WinRAR\WinRAR.exe"" e -- *.rar * $nn-temp",,1;   //   <= extract all *.rar files in current folder to one common folder
   //Msg("Press OK when WinRAR is finished.",1);
   GoTo("<curpath_s>\$nn-temp");
   Sel(a);
   Rename(b,$cf);
   Focus(L);
   MoveTo("..\..");
   #523;
   #523;
   Rename(b,$nn,"$cp");
   SelFilter($nn, d, Name);
   Focus(L);
   delete 1, 0, ;

zer0
Posts: 2676
Joined: 19 Jan 2009 20:11

Re: How to transform OpenWith into Run?

Post by zer0 »

Nice one Stefan, that's exactly what I was after. My mouse will be able to take a breather now and then :lol:
Reporting a bug? Have a wish? Got a question? Use search - View roadmap - FAQs: Forum + XY site
Windows 7/10
Always using the latest stable two-decimal build

Post Reply