
Multi-combo of script(s) and UDC(s)
-
ivan
- Posts: 577
- Joined: 02 Apr 2008 12:52
- Contact:
-
TheQwerty
- Posts: 4373
- Joined: 03 Aug 2007 22:30
Another take on the solution:
Could probably do without the last rename and selfilter, but I wanted to make sure the correct folder is deleted.
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;
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:
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 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
I'm not sure I understand exactly what you're asking but try changingivan 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
Code: Select all
GoTo("<curpath>\%nn%-temp")Code: Select all
GoTo("<curpath_s>\%nn%-temp")-
ivan
- Posts: 577
- Joined: 02 Apr 2008 12:52
- Contact:
-
ivan
- Posts: 577
- Joined: 02 Apr 2008 12:52
- Contact:
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 wrote:The change I mentioned in the last post seems to fix that for me, does it not work for you?ivan wrote: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
You could split the script into two parts and execute one to start extraction and the other to do the moving and cleaning.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 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:
Now there is an idea for him to think aboutTheQwerty 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.
But I think Undo function should have more priority
-
ivan
- Posts: 577
- Joined: 02 Apr 2008 12:52
- Contact:
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?
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:
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...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?
FAQ | XY News RSS | XY X
-
ivan
- Posts: 577
- Joined: 02 Apr 2008 12:52
- Contact:
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:
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.
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;
-
admin
- Site Admin
- Posts: 66298
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Step through the section using step: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:
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.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;
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;
FAQ | XY News RSS | XY X
-
ivan
- Posts: 577
- Joined: 02 Apr 2008 12:52
- Contact:
I "stepped" through the script and this is the part that takes several seconds (the majority of those 8 overall, I'd say)
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.
Code: Select all
Rename(bat,%nn%,,"%cp%");-
admin
- Site Admin
- Posts: 66298
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
I did not follow this thread (been coding...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)
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.Code: Select all
Rename(bat,%nn%,,"%cp%");
FAQ | XY News RSS | XY X
XYplorer Beta Club

