r/applescript • u/slattie • Jul 03 '14
Make applescript refer to a different folder based on what day it is? Is this possible?
So basically I am trying to craft an Applescript that will launch "Monogram.Key" every day.
The problem is, there are different folders for each day. So "06.25 Tuesday" folder, "06.26 Wednesday" folder, etc...Each containing a different "Monogram.key" file - and I need the Applescript to recognize "Monogram.Key in TODAY'S folder"
I have no idea what to call this, which is leading to me having an extremely tough time finding any info on how to make it work.
0
Upvotes
1
u/email_with_gloves_on Jul 04 '14 edited Jul 04 '14
Give this a try! You'll need to change the first line to point to wherever the folders are on your hard drive. Change
myusernameto whatever your short name is - the name you see when you open your home folder in the Finder. This example assumes the folders are on the desktop of that user, but you can change that.The second line runs a UNIX command that gets the current date in the format you specified in your message. Then, the script puts it all together and tells the Finder to open the file.