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

Automator displays date variable with custom format wrong

I am trying to use "Today's Date" variable and customize the Date's format as shown in the image below. When I do this, Automator does not display the custom format date but some weird character sequence that looks like an ID, e.g., $(92529D1B-C55F-461F-955F-420F7DA54178) (please see below).


Is this a known issue or does anyone know what causes it/how to fix it? I've tried on multiple machines, getting same [wrong] result.


Thanks in advance for any suggestions!


Posted on Aug 16, 2021 7:32 AM

Reply
Question marked as Best reply

Posted on Aug 16, 2021 8:11 AM

When you edit the Today's date to a custom format, you must remove and re-add the modified variable name to the Add: field in the Automator action. That will replace the UID string with the actual custom date string in the filename:


5 replies

Aug 16, 2021 10:35 AM in response to ikourtev

Thanks VikingOSX, the remove, then add procedure you described solved the problem.


Spoke a little too fast. The procedure works in the sense that the example in the Automator action panel displays correctly.


I still encountered an issue in that if I wanted to append <space character> followed by the formatted date—transforming "name" into "name 20210816"—I could not accomplish this by entering a space followed by the variable in the Add: box text field. The Automator example displays properly but the net result (of applying the action) still contains the UID and not the correct date string. So there seems to be a problem with a space character being the first character in the Add: box text field (although a string literal with a leading space, e.g., " hello" does work).


Played around with it and figured out that a space character can be the last character. So a workaround is to first add a <space character> to the file name, then add the formatted date (see below). Maybe a text box cannot contain a leading space before a variable by design but without documentation it's hard to tell whether this is documented behavior or a bug.



Aug 16, 2021 11:46 AM in response to ikourtev

You could use a space character that precedes the custom date string when modifying the Today's Date variable. I have tested that without entering any leading space in the Add: field and it works just fine. You are on a UNIX system and my advice would be to no use an underscore instead of a space in the filename, if you must have a separator at all.

Automator displays date variable with custom format wrong

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