GP SoftwareTwitter
Opus FAQsManualCommandsObjects

SELECT user command

I am a novice at creating user commands. I am trying to create a user command to SELECT files based on their creation date being TODAY]. I have searched FAQ and examples of new commands and can't find anything related to he SELECT based on the date criteria I need. Any help would be appreciated.

I'm new to (the current) DOpus as well.

I had a look and the closest I could come to what you are after is to go to Preferences->File Operations->Filters and create a new Filter with the expression:
Date Match Created Within 1 day

You could then create a button with the command:
Select FILTER="Created Today"

I'm not sure if this will include files created yesterday (after the current time of day). The other date filter expressions require you to specify an exact date, which isn't useful in this case. It would make more sense if you could specify a token "date", which inserts the current date. I'd also like to know how to represent this select filter expression in the actual button, as an alternative to creating a separate Filter.

But like I said, I'm new to this, so perhaps someone else has another answer.


[ol][li] Manually create a resuable Filter. Since you want to eventually select files based upon this filter, start with the command button below:

<?xml version="1.0"?> <button display="both" separate="yes"> <label>Select Ad&amp;vanced</label> <tip>Selects files based on advanced file selection criteria other than the just filename</tip> <icon1>93</icon1> <function type="normal"> <instruction>Select ADVANCED MAKEVISIBLE </instruction> </function> </button>
[li] With the button above on your toolbar, list a folder that contains at least one target file that your filter should apply to.
[li] With the folder listed, click the button I provided; a filter dialog will appear.
[li] In the image below, you will see I've created a filter named Modified Today. Create the same filter, test it, then save it with the same name for now. You can now use this filter in a toolbar button with the Select raw command (you can also reuse it in other places as well).

NOTE: Saved filters can be used in many places within Opus, so if you later modify your filter, keep in mind all the places where you use it!
[li] The button you are really after is this one; it uses the filter you created above.

<?xml version="1.0"?> <button display="both"> <label>Select Today</label> <tip>Selects files based on the &quot;Modified Today&quot; filter</tip> <icon1>93</icon1> <function type="normal"> <instruction>Select FILTER=&quot;Modified Today&quot; FILTERFLAGS=select,hidenomatch </instruction> </function> </button>[/li][/ol]

FAQ: How to add buttons from this forum to your toolbars

Now, I expect you to open the Manual or Help file, and read all about Filters, and the Select raw command while this is still fresh in your memory.

@sinx Great job, for a newbie! I was typing a step-by-step while you answered him quite correctly. I hereby promote you from newbie to acolyte of the first order, and protector of the realm. And I expect to see you answer more questions in the future.

BTW, I just tested the command before I posted and as I note above "Within 1 day" means on the same calendar day, not necessarily within 24 hours.

Thanks to sinx and kenalcock ! I appreciate the assist. What seems pretty simple to some is really quite complex for me.

An alternate way to achieve similar results would be to reverse sort the lister by last modified date (or creation date if you have that column showing). Then all the files/folders you want will be at the top of the lister where it's easy to select them.

That's what I always do instead of messing around with filters. I'll sort the lister as I want (sometimes in flat view sometimes not) so the files I want are at the top. When I'm done doing whatever with them I reset the sort back to my default. By the way, I do this using lister styles.