Page 1 of 1
Run script on Search Results Tab?
Posted: 09 Nov 2010 19:49
by EnjoyRC
Is it possible to run a script on the search results tab?
Example, If I perform a "Date" search for any file that was modified within the past 30 hours.
And now, for each file in the results list, I'd like perform some actions. (Source)
Copy it to a different location (Destination), ONLY if the (Source) last modified date is newer than the (Dest).
Re: Run script on Search Results Tab?
Posted: 09 Nov 2010 19:50
by EnjoyRC
Man, they XYplorer is absolutely amazing. I can do anything with it!!!
Re: Run script on Search Results Tab?
Posted: 09 Nov 2010 20:23
by Stefan
EnjoyRC wrote:And now, for each file in the results list, I'd like perform some actions.
Do an right click on an file or an selection -on the result tab- and chose an option.
Did this help?
EDIT
Ooh, we are in "Script Exchange" and you want to run an script on the search result tab?
Yes, you can.
Test this:
- search a few files
- when the search results are shown,
---- select an file
---- open "Scripting > Run Script..."
---- and paste this script into the dialog
Code: Select all
while(1)
{
msg "<curname>",1;
sel +1; end ("<curname>"=="");
}
---- click on OK and you should see several messages boxes promting you the file names.
Re: Run script on Search Results Tab?
Posted: 09 Nov 2010 20:33
by serendipity
EnjoyRC wrote:Man, they XYplorer is absolutely amazing. I can do anything with it!!!
Choose one.
(A)You figured out how to do it?
(B)You are displaying your amazement for XY?
(C) Both
Re: Run script on Search Results Tab?
Posted: 09 Nov 2010 21:42
by EnjoyRC
serendipity wrote:EnjoyRC wrote:Man, they XYplorer is absolutely amazing. I can do anything with it!!!
Choose one.
(A)You figured out how to do it?
(B)You are displaying your amazement for XY?
(C) Both
(B)... he he he.. I'm gonna try the scripting on Results now.
Re: Run script on Search Results Tab?
Posted: 09 Nov 2010 21:48
by EnjoyRC
Thank you so much for your responses...
I can see how it cycles through each selected file name. Yet, how can I access the other columns? Path, size, dates, etc... I'd need to append Path and Name to get the true file path. And as described above, I'm wanting to do some calculations on the file dates.
Also, you need to be careful which way you mark the files. It starts with the boxed one. Not just the first selected.
Mark
Re: Run script on Search Results Tab?
Posted: 09 Nov 2010 22:19
by Stefan
>Yet, how can I access the other columns? Path, size, dates, etc...
Open Help > "Advanced Topics > User-Defined Commands" and take an look at "XYplorer Native Variables"
Try this script:
msg "<curpath> - <cursize> - <datem yyyymmdd_hhnnss>";
Or take a look at "Scripting Commands Reference" and there report() command.
>I'd need to append Path and Name to get the true file path.
Exchange "<curname>" with "<curitem>" in my example script.
>And as described above, I'm wanting to do some calculations on the file dates.
Take a look at "Scripting Commands Reference" and there datediff() command.
>Also, you need to be careful which way you mark the files.
>It starts with the boxed one. Not just the first selected.
Depends on your needs and your description what you want to do. Then the script can follow your wish.
If you need help on this - just ask with an exact description what the script should do.
There are enough coders here to aid you getting started.
.
Re: Run script on Search Results Tab?
Posted: 09 Nov 2010 22:53
by EnjoyRC
Stefan wrote:>Yet, how can I access the other columns? Path, size, dates, etc...
Open Help > "Advanced Topics > User-Defined Commands" and take an look at "XYplorer Native Variables"
Try this script:
msg "<curpath> - <cursize> - <datem yyyymmdd_hhnnss>";
Or take a look at "Scripting Commands Reference" and there report() command.
>I'd need to append Path and Name to get the true file path.
Exchange "<curname>" with "<curitem>" in my example script.
>And as described above, I'm wanting to do some calculations on the file dates.
Take a look at "Scripting Commands Reference" and there datediff() command.
>Also, you need to be careful which way you mark the files.
>It starts with the boxed one. Not just the first selected.
Depends on your needs and your description what you want to do. Then the script can follow your wish.
If you need help on this - just ask with an exact description what the script should do.
There are enough coders here to aid you getting started.
.
Thank you, Thank you.. this defintely points me in the right direction.
Re: Run script on Search Results Tab?
Posted: 10 Nov 2010 09:22
by admin
EnjoyRC wrote:Is it possible to run a script on the search results tab?
Example, If I perform a "Date" search for any file that was modified within the past 30 hours.
And now, for each file in the results list, I'd like perform some actions. (Source)
Copy it to a different location (Destination), ONLY if the (Source) last modified date is newer than the (Dest).
FYI, such a functionality is built in, you don't need to script this. Loop up the Help for "Backup"...
Re: Run script on Search Results Tab?
Posted: 10 Nov 2010 20:18
by EnjoyRC
admin wrote:FYI, such a functionality is built in, you don't need to script this. Loop up the Help for "Backup"...
Oh yeah... Guess what I just found?
Rich Copy That's the ticket Don... Been a long time since I found a new piece of software that was gonna find it's way into most of my development tasks that I do each day.