I'm trying to create a button that runs a script that does these things:
Finds the (single) most recently created or modified file with the .TXT extension anywhere on drive F:\ (including subfolders)
Creates a new lister window in that folder
Here's my script that uses a premade filter:
Find custom_txt_filter IN F:\ FILTER
Go FROMSEL NEW 900,400,300,400 VIEW=list
The script opens a Find results view that shows me the most recent .TXT file, but does not open a new lister window anywhere.
I think the problem is related to the fact that Find results are not instantaneous and the rest of the script commands after the Find command are being run before the Find has time to print the results.
Any help would be greatly appreciated!
Using Find / Select / Go probably won't produce great results. If you want to automate this kind of thing, using scripting is usually best.
Opus has a scripting helper which makes it really easy to loop through all the files in or below a folder (the default/sample script in the button editor has an example of using it). You'll also be given details like the date and extension of each file, which you can compare to find the newest .txt file. Once you have it you can then run a command on it, or whatever you want.
Thanks for pointing the way! I'll definitely have to take a deeper look into actual scripting, but with zero programming experience, starting off still seems a bit daunting.
In the meantime I managed to come up with somewhat of a workaround using flat view, and details view with custom column sorting.
The only weird thing that's stumped me is that I can't for the life of me find which internal command enables/disables custom filters you've made? I have a filter that shows only .TXT files and ones created in the last hour, but I don't know what command to use to activate it in the lister.
I'd have a very satisfactory solution if only this piece of the puzzle would work out.
PS: I've had Directory Opus for a few months now and it's easily the single greatest software purchase I've ever made. My workflow and effectiveness has improved so much I didn't think it possible. A big thanks to all the developers!