Multi-combo of script(s) and UDC(s)

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
ivan
Posts: 577
Joined: 02 Apr 2008 12:52
Contact:

Post by ivan »

Here's the screenshot of the script window, maybe I messed up copy/paste:

Image

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Post by TheQwerty »

Another take on the solution:

Code: Select all

Set(%cf%,<curfolder>);
	Set(%cp%,<curpath>);
	Set(%nn%,<date yyyymmddhhnnss>);
	OpenWith("""C:\program files\winrar\winrar.exe"" e -- *.rar * %nn%-temp\", "s");
	Msg("Press OK when WinRAR is finished.",1);
	GoTo("<curpath_s>\%nn%-temp");
	Sel(a);
	Rename(bat,%cf%);
	Focus(L);
	MoveTo("..\..");
	#523;
	#523;
	Rename(bat,%nn%,,"%cp%");
	SelFilter(%nn%, d, Name);
	Focus(L);
	#169;
Could probably do without the last rename and selfilter, but I wanted to make sure the correct folder is deleted.
Last edited by TheQwerty on 27 Jun 2008 12:56, edited 1 time in total.

ivan
Posts: 577
Joined: 02 Apr 2008 12:52
Contact:

Post by ivan »

TheQwerty, this works great!

I don't even mind the prompt asking me to click when WinRAR finishes. However, there is one hiccup. I extract from a folder that's on Desktop, but upon extraction and confirmation it expands my folder tree and goes to C:\Documents and Settings\username\Desktop. Although this is correct but I am wondering if there is any way to keep the focus on the Desktop the way I have? Cheers :)

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Post by TheQwerty »

ivan wrote:TheQwerty, this works great!

I don't even mind the prompt asking me to click when WinRAR finishes. However, there is one hiccup. I extract from a folder that's on Desktop, but upon extraction and confirmation it expands my folder tree and goes to C:\Documents and Settings\username\Desktop. Although this is correct but I am wondering if there is any way to keep the focus on the Desktop the way I have? Cheers :)
I'm not sure I understand exactly what you're asking but try changing

Code: Select all

GoTo("<curpath>\%nn%-temp")
to

Code: Select all

GoTo("<curpath_s>\%nn%-temp")

ivan
Posts: 577
Joined: 02 Apr 2008 12:52
Contact:

Post by ivan »

This is what I mean:

The folder from which the initial extraction started was located on the Desktop in FZ folder like this

Image

but after finishing the whole deal the focus shifted to Desktop through this tree:

Image

So, while they are technically the same, they are also different if you know what I mean.

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Post by TheQwerty »

ivan wrote:So, while they are technically the same, they are also different if you know what I mean.
The change I mentioned in the last post seems to fix that for me, does it not work for you?

ivan
Posts: 577
Joined: 02 Apr 2008 12:52
Contact:

Post by ivan »

TheQwerty wrote:
ivan wrote:So, while they are technically the same, they are also different if you know what I mean.
The change I mentioned in the last post seems to fix that for me, does it not work for you?
Yep, that did the trick. Of course the next step would be to ask if it's possible not to have the prompt about WinRAR finishing but if there's no way around then i'll settle for what I have, thank you very much.

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Post by TheQwerty »

ivan wrote:Yep, that did the trick. Of course the next step would be to ask if it's possible not to have the prompt about WinRAR finishing but if there's no way around then i'll settle for what I have, thank you very much.
You could split the script into two parts and execute one to start extraction and the other to do the moving and cleaning.

You could write a different script which creates and executes a batch file to do everything from the extraction out.

You could write an external program to do everything from the extraction out.

But to do it all within XY sans prompt you'll have to come up with a way for Don to handle pausing the script until the extraction is completed and wait till it's implemented.

ivan
Posts: 577
Joined: 02 Apr 2008 12:52
Contact:

Post by ivan »

TheQwerty wrote:But to do it all within XY sans prompt you'll have to come up with a way for Don to handle pausing the script until the extraction is completed and wait till it's implemented.
Now there is an idea for him to think about 8) Scrow-Mo :lol: (combo of script and slow-mo)

But I think Undo function should have more priority :D

ivan
Posts: 577
Joined: 02 Apr 2008 12:52
Contact:

Post by ivan »

Here's an interesting question: what factors influence how fast a script can run?

The thing is that I just timed this script and from the moment I click OK (to confirm that WinRAR has finished) to the point when I'm asked if I want to put the folder in recycle bin all of 8 and a bit seconds go by. Now I'm wondering if there's intentional delay there and if so then can it be adjusted? If it's not a delay then why does it take 8 seconds to rename a file, move it up a tree and prompt for deletion? :?

admin
Site Admin
Posts: 66298
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Post by admin »

ivan wrote:Here's an interesting question: what factors influence how fast a script can run?

The thing is that I just timed this script and from the moment I click OK (to confirm that WinRAR has finished) to the point when I'm asked if I want to put the folder in recycle bin all of 8 and a bit seconds go by. Now I'm wondering if there's intentional delay there and if so then can it be adjusted? If it's not a delay then why does it take 8 seconds to rename a file, move it up a tree and prompt for deletion? :?
Walk it step by step (= use stepping mode) and see which particular command takes that long. There is no delay as far as I know, and I should know... :wink:

ivan
Posts: 577
Joined: 02 Apr 2008 12:52
Contact:

Post by ivan »

As I said, the part between me clicking OK after WinRAR finishes extraction and when I get a prompt to move the folder to Recycle Bin is one that takes by far the longest time (obviously excluding the extraction time because XYplorer can't influence that), so this section:

Code: Select all

GoTo("<curpath_s>\%nn%-temp");
Sel(a);
Rename(bat,%cf%);
Focus(L);
MoveTo("..\..");
#523;
#523;
Rename(bat,%nn%,,"%cp%");
SelFilter(%nn%, d, Name);
Focus(L);
#169;
takes over 8 seconds to execute. I am simply wondering why that is and if there's anything I can do to reduce this period of time.

admin
Site Admin
Posts: 66298
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Post by admin »

ivan wrote:As I said, the part between me clicking OK after WinRAR finishes extraction and when I get a prompt to move the folder to Recycle Bin is one that takes by far the longest time (obviously excluding the extraction time because XYplorer can't influence that), so this section:

Code: Select all

GoTo("<curpath_s>\%nn%-temp");
Sel(a);
Rename(bat,%cf%);
Focus(L);
MoveTo("..\..");
#523;
#523;
Rename(bat,%nn%,,"%cp%");
SelFilter(%nn%, d, Name);
Focus(L);
#169;
takes over 8 seconds to execute. I am simply wondering why that is and if there's anything I can do to reduce this period of time.
Step through the section using step:

Code: Select all

Step;
GoTo("<curpath_s>\%nn%-temp");
Sel(a);
Rename(bat,%cf%);
Focus(L);
MoveTo("..\..");
#523;
#523;
Rename(bat,%nn%,,"%cp%");
SelFilter(%nn%, d, Name);
Focus(L);
#169;
BTW, instead of #523;#523; (Up Up) use can use #521; (Go to Last Target).

ivan
Posts: 577
Joined: 02 Apr 2008 12:52
Contact:

Post by ivan »

I "stepped" through the script and this is the part that takes several seconds (the majority of those 8 overall, I'd say)

Code: Select all

Rename(bat,%nn%,,"%cp%");
If the command in that script is a time-consuming one then it's ok, but it can be influenced by any factors that I can do something about then it's worth a try.

admin
Site Admin
Posts: 66298
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Post by admin »

ivan wrote:I "stepped" through the script and this is the part that takes several seconds (the majority of those 8 overall, I'd say)

Code: Select all

Rename(bat,%nn%,,"%cp%");
If the command in that script is a time-consuming one then it's ok, but it can be influenced by any factors that I can do something about then it's worth a try.
I did not follow this thread (been coding... :wink: ), so what is %nn% and%cp%?

Post Reply