Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to use automator to create a project folder with a Automator service, but i like to add the month and year (with two decimals) not the day, month and whole year.

want i can creatie is item_29022014 but i like to create a file named: 'item_0214' where the first two numbers (02) are the month and the last two numbers (14) are the last to numbers of the current year(2014).

Can i download some add-on for automator? Or do i need a custom script for this?

enter image description here

share|improve this question
I am confused, try again. Is that a part of file name? – Buscar웃 Feb 13 '14 at 19:37
i cant explain my self better then this. – mvaneijgen Feb 13 '14 at 19:42
great job, it is clear now. – Buscar웃 Feb 13 '14 at 20:07

Check the answer found here

I changed the bash script code to include the date code.

shopt -s extglob
dcode=`date '+%m%y'`
for f in "$@"; do
   if [ "$f2" == "$f1" ] ; then     
       echo "$f" "${f1}_${dcode}"
       echo "$f" "${f1}_${dcode}.${f2}"

The code will should work even with files that do not have extensions.

Replace the commands echo with mv to actually get the code to do anything.

Hope that helped.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.