Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

xieem

macrumors member
Original poster
Oct 7, 2014
32
2
Brussels
Hi,

I was wondering if it would be possible to run an Applescript that would create a new folder every time there is a new month? This would be useful for accountancy purposes that it would also check certain file types for a date and put that file automatically in that folder.

Not sure if that would be doable but if yes any idea how to start?
 
It's most certainly possible. You could do it in AppleScript. Personally, I'd probably do it with a shell script. For example the following makes a folder on your desktop named with the current year and month:

Code:
mkdir -p "~/Desktop/$(date +%Y-%m)"

(copy and paste it into Terminal, found in your Utilities folder).

From then on, its just a question of scheduling the command to run at a specific time. You could use Automator to create a calendar alarm to schedule the script. Automator has a "Run Shell Script" tool. There are more elegant ways, but that's probably the easiest method.

Hope that's of some help!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.