Move Two Files from One Folder To Another?

Hi All, I have a script which creates two files overnight each night, and puts them on my desktop. The names of these files are something like Filename 2018-10-10 (1) and Filename 2018-10-10 (2).

Obviously these files' names change based on the then-current date. I'd like to create a macro to move these files daily to another Folder, let's call it Folder 2. Ideally I'd like to avoid AppleScript coding, and do it solely with KM if possible.

About those two files.... At the time I'll run this macro to move them,

  • They will be the two most recent files on the desktop

  • They'll be the only files on the desktop created today

  • They'll be the only files on the desktop with the word "Filename" in them

  • They'll be the only .csv files on the desktop

  • Unfortunately they won't be the only files on the desktop though, so I can't just sweep the entire contents of the Desktop to Folder 2.

Anyone got any ideas on how to select these two files with variable names and move them to Folder 2?

Thanks! --Tim

Why do you want to avoid AppleScript ?

I don't know how to write AppleScript well - I know how to run an existing AppleScript from KM, but I'm not good at writing it. If someone posted a perfect, fully completed AppleScript that I could run from KM I guess that would be fine! But in general, the answer to your original question is, that I'm not very skilled in AppleScript.

Move .CSV Files ~:Desktop → Folder 2 .kmmacros (16.8 KB)

1 Like

Looks great - I'll play around with it on some sample data first - much appreciated, this looks like it will get me close enough to figure it out myself if it doesn't work perfectly as-is. Much appreciated!

I just updated it. I noticed an error, which then motivated me to actually test it myself. It was a minor but important change, and I can confirm the macro works now.

Hi CJK - Worked perfectly! Thanks again.