Automatically Remove the Specified ZIP File on the Desktop

When the specified time comes, can you create a macro to delete the specified name (for example, 2022) Zip file on the desktop?

If you have any questions, please ask anything.
Thanks,

Yes. Look at the last macro I made for you. The cron trigger and trash actions are all you need. Simple.

Hello noisneil!
Thank you very much for yesterday. Actually this macro is a continuation of yesterday.

As you say, this macro is pretty much the same as yesterday.
But I don't know variables to look for file characters.
I'm Japanese also I have never programmed. So I'm having a hard time learning about variables in this macro lol

Can you be a bit more clear about what you're trying to do? Do you want the archive we created to be deleted? Will the archive names feature anything consistent to differentiate from other archives you may not wish to delete?

Side-note:

You can edit comments here; no need to delete and post another comment. Also, for future reference, it's ok to continue a thread after your initial question has been answered, so this thread could have been a continuation of the last one. Not important of course, but it would have alerted me to your new question with some context.

1 Like

It is a macro that automatically uploads files generated by Photoshop.
It is a slightly complicated macro.

As I told you before, I made the macro with another software. But the condition of the software is not very good. That's why I convert that action to a keyboard maestro.

I'm not sure that you fully understand this explanation.
Since I am English beginner.
If you have any questions, please ask a question.

Thanks,

Ok, hopefully this is what you're after...

Delete Archives (> 2hrs Old).kmmacros (38 KB)

Macro screenshot

One thing to bear in mind is that you'll actually want to trigger this more than 2hrs after the archives were created, as creating them is not instantaneous.

1 Like

Wow...

You understand my English and made a very difficult macro. It deserves respect. Thank you!

If you are fine, may I ask you two questions? It's about what happens if I change your macro.

If I want to change the time how do i change it?

For example I alter it for 1 hour or 3 hours. I will send you a photo. Does it work?

2022_09_07_01

2022_09_07_02

If I exclude the creation date condition from your macro, is it possible to transform like this?

I appreciate your great help!

Just change the 2 in Neil’s original calculation to the amount of hours you want.

So for 1 hour it would be 60 x 60 x 1
For 3 hours it would be 60 x 60 x 3

2 Likes

@cdthomer has given you the correct calculations above. As the times are in seconds, it's:

60sec x 60min x number of hours.

You can indeed remove the file age component of the macro and it will trash any files that meet the remaining criteria.

1 Like

Okay. I thought it could be easily replaced. But it seems difficult.
Thank you for your wonderful support.

It is easy!

Local__TimeDiffSec > (60*60*1)
Local__TimeDiffSec > (60*60*3)

You're only changing the final number, which represents the number of hours.

1 Like