Author Topic: A New Token  (Read 6774 times)

iceblast

  • Sr. Member
  • ****
  • Posts: 374
A New Token
« on: August 27, 2016, 10:00:52 PM »
Was wondering if you could make a new Token that gave the Date, Time, and Seconds all in one Token.

Reason: I want VA to save a file, with Date, Time, and Seconds in the file name. So it could look something like this. C:\txt\Name {DATETIMESECONDS}.txt

File created would be, Name August 27, 2016 11:13:24PM

I've tried making Variables, but doesn't seem like VA will except them. File not written (The given path's format is not supported.)

I can do Name {DATE}.txt, but not Name {time}.txt, it will do Name {TIMEMINUTE}.txt or Name {TIMESECOND}.txt but you can't seem to combine them, or make a Variable to combine them.

This would make it, so every time you save the file, it will have a unique name, and won't overwrite the file.

Sorry, if there is another way to do this already within VA, and I'm missing it. Simple Variables appear to work, but not more then one Token at a time. Even tried EXP: with no luck.

I can write {Date} {time} {TIMESECOND} to a file, but when I try to make that file a Variable is errors out again. simple variable works fine, even {EXP: 'welcome' + ' ' + 'captain' } works, but you can't use tokens or variables into it.

Thanks for your time.




Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: A New Token
« Reply #1 on: August 27, 2016, 10:12:58 PM »
That's because Windows doesn't allow you to use a colon(":") in a filename.

Try "{DATEYEAR}_{DATEMONTHNUMERIC}_{DATEDAY} {TIMEHOUR}_{TIMEMINUTE}_{TIMESECOND}{TIMEAMPM}", so your command is portable to systems that use slashes as a date separator(which is also an illegal character in a Windows filename).

iceblast

  • Sr. Member
  • ****
  • Posts: 374
Re: A New Token
« Reply #2 on: August 27, 2016, 10:27:48 PM »
I didn't even think of illegal characters.

This did the trick.

C:\VA\Apps\Clipboard {DATE}_{TIMEHOUR}-{TIMEMINUTE}-{TIMESECOND}{TIMEAMPM}.txt

Thanks again for the help.

Technomancer

  • Jr. Member
  • **
  • Posts: 98
  • I have a bad feeling about this...
Re: A New Token
« Reply #3 on: August 28, 2016, 11:43:19 AM »
Whoa!! Whoa!!

You can designate the file name via TOKENS in the save as dialog of the "Write Text to a File" dialog???

Just confirming I understood this feature before I go all GEEK!  ;D

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
Re: A New Token
« Reply #4 on: August 28, 2016, 11:49:52 AM »
You can designate the file name via TOKENS in the save as dialog of the "Write Text to a File" dialog???

The tooltip for the "Output File" textbox says "This is the file path of the file you want to write. Note that this can also be any combination of replacement tokens.".

Technomancer

  • Jr. Member
  • **
  • Posts: 98
  • I have a bad feeling about this...
Re: A New Token
« Reply #5 on: August 28, 2016, 11:57:30 AM »
Wow...of all the boxes I hover over to get tips, I never did it with this one.  :o

SCHWEEET!!!