Want to highlight a helpful answer? Upvote!

Did someone help you, or did an answer or User Tip resolve your issue? Upvote by selecting the upvote arrow. Your feedback helps others! Learn more about when to upvote >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Automator script for DATE and TIME stamped folder

hi all,


i am not a scripter but have a need for a DATE and TIME stamped folder (or file) that i would like to place on my desktop and have updated automatically so that i can use this tool to quickly see if an external (or internal) backup is current. presumably i could also use this to quickly know how /old/ a backup is.


right now i do this manually if i want to quickly verify that a backup is working by creating a "date named folder" on the desktop - such as "- - 2016 03 26". this way i can quickly see if a backup i just ran ran.


i have a lot of backups (internal, external, off site etc) and it would be a super useful tool for me to have.


i am envisioning the name of the folder to be (potentially) customizable in case i need to change it but a good default would be "- - YEAR MONTH DATE" so that i could easily see when this backup was but also i name my files in this manner so they can show up chronologically".


is anyone able to help me out with something like this or suggest another forum to cross-post this to?


THANKS


jon

MacBook Air, OS X Yosemite (10.10.1), 11 inch, early 2015, 2.2 GHz Core 7

Posted on Apr 5, 2016 11:57 AM

Reply
Question marked as Best reply

Posted on Apr 6, 2016 6:11 AM

Hi,


Create the the "New Folder" action, like this:

User uploaded file

---------------



Drag/drop the "Shell Script" variable into the "Name:" field.

User uploaded file

--------------



Double-clic on the variable in the "Name:" field:

Copy/paste this text in the "Script" field:

date "+%Y %m %d"


User uploaded file

5 replies

Apr 6, 2016 11:02 AM in response to hotwheels22

hotwheels 22 wrote:



can I please ask you if this script will update itself with a new date time automatically or if I need to do this manually somehow? I was hoping for the automatically updated folder name but was not sure if I was clear about this!

THANKS


No, this workflow create a new folder.



For renaming an existing folder:

You need to create an alias of your folder, you can move this alias anywhere.


Create a workflow like this:

User uploaded file


Drag/drop the alias in the first action.


Clear all the text in the second action.

Copy/paste this text in the second action:

------------------

on run {input, parameters}

set t to do shell script "date '+%Y %m %d'"

tell application "Finder"

set myFolder to original item of (item 1 of input)

set name of myFolder to t

end tell

end run

------------------


This script get the original folder from the alias, and update the folder name.

Jun 13, 2016 11:29 AM in response to Jacques Rioux

hi jacques.


are you still around? i would like to try this as i try to fix some workflow issues but i am getting hung up with automator. i used it once but now i am having a hard time.


if i want to create a DATED folder that has the current date on it.


do you want me to create a folder on the desktop or do you want me to create a folder within automator somehow? when i open automator i only get the pulldown menu items and no dialog box. so i have to go to FILE > NEW and then i see this:


am i starting out wrong?


am i supposed to create a new folder from /within/ automator or do i only paste the script into automator?


i am confused mostly because i have not used this software before...


THANKS


jonUser uploaded file

Jun 13, 2016 5:00 PM in response to hotwheels22

hotwheels 22 wrote:




am i supposed to create a new folder from /within/ automator or do i only paste the script into automator?


i am confused mostly because i have not used this software before...




An workflow saved as Workflow can be run from within the "Automator" application

An workflow saved as Application can be run when you launch it


So, from the Automator application:

Select the "Workflow" or the "Application" icon, press the "Choose" button.


Types "Specified Finder items" in the search field

User uploaded file



Double-click on the "Get Selected Finder Items" action to put it into the workflow


Types "Apples" in the search field

User uploaded file


Double-click on the "Run AppleScript" action to put it into the workflow.


After:

Drag/drop the alias of your folder in the first action.

Copy/paste the script into the second action

Save the workflow.

Automator script for DATE and TIME stamped folder

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.