Benches macOS

1

Add date to new text file name and generic text in body

apple Verified

Imported from the Apple Support Forums via the Wayback Machine 🔗

Okay, I hope this is the right forum. To help manage and keep track of incoming assets/files and I created an Automator workflow with the following: "Get Selected Finder Items → Get Folder Contents → New Text File (w/Show this action when the workflow runs so I can give a unique name).

This creates a text file with the folder contents listed in the body.

I would like to know if I can do two things:

1. Automatically add a date/time stamp to the Save as field so it will automatically have a unique file name?

2. I also want to add text before the listed contents within the text file. (e.g.: Let's say the folder contents are Volumes/Mac HD/Generic_movie.mov. I want the final text to read:

"The following file has been moved to the local volume at: Volumes/Mac HD/Generic_movie.mov"

Is there a way to accomplish either one or both of these with Automator or AppleScripts?

Thanks.

1 reply

Sign in or join Beachball Help to reply.

  1. 0

    Andrew99

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    I would like to know if I can do two things...

    This might address your first concern:

    *1) Get Selected Finder Items*

    *2) Get Folder Contents*

    *3) New Text File* -- select a destination folder and check *Show Action When Run*

    *4) Rename Finder Items:*

    Choose *Add Date or Time* from the popup

    Date/Time: select
    Created,
    Modified, or
    Current - Format: *Month Day Year*

    Where: *After name* - Separator: *Forward Slash*

    Separator:
    Space - check *Use Leading Zeros* (optional)

    *5) Rename Finder Items:*

    Choose *Add Text* from the popup

    Add: *" at"* -- put a leading space before "at" (without the quotes), and select *after name*.

    *6) Rename Finder Items:*

    Choose *Add Date or Time*

    Date/Time:
    Current - Format: *Hour Minute Second*

    Where: *After name* - Separator:
    Dash

    Separator:
    Space - check *Use Leading Zeros* (strongly recommended)

    +--- End of Workflow ---+

    Save the workflow as an application and use it as a droplet. Drop a desired folder onto the saved applet and enter a name when the dialog appears. The new text file, which will be found in the destination folder, should be appended with a date and time stamp, e.g., *"My Folder List 7/8/2010 at 23-54-09"*

    Tested using Mac OS 10.4.11 and Automator v. 1.0.5

    Good luck; hope this helps.