two questions about macro with date

You have a question or need an advice about how to do something? Ask it here!
Post Reply
marvex
Posts: 38
Joined: 10 Nov 2022 12:13
two questions about macro with date

Post by marvex »

  • Thanks to Bernd I figured it out and tested and know how works macro with fixed name:
    Show1-22-11-14.mp3
    Show1-22-11-15.mp3
macro must be: ( and it's works)

Code: Select all

Show1-${start_yy}${start_MM}-${start_dd}.mp3
  1. Can I make macro for files like that (with variable ending) ?
    Show2-22-11-14-Name1_Surname1.mp3
    Show2-22-11-15-Name2_Surname2.mp3
something like that ?

Code: Select all

Show2-${start_yy}${start_MM}-${start_dd}-*.mp3
  • And second question - lets say show1 is on the air at night and for that I can use macro like the first one, but when I want but shame show for next day in the morning show, can I do it with macro ?
something like that ?

Code: Select all

Show1-${start_yy}${start_MM}-${start_dd(-1)}.mp3
User avatar
radio42
Site Admin
Posts: 8295
Joined: 05 Apr 2012 16:26
Location: Hamburg, Germany
Contact:
Re: two questions about macro with date

Post by radio42 »

1. A flename (entryname) using the LoadTrack script-line mode must be unique, as else, a file could not be loaded. As such, a wildcard can not be used, as it would not be clear, which file to use and load.

2. Yes, this is possible.
In this case you can use the *[DATE:...] macro function to add or subtract a certain number of days by using the ${start} macro.
Let's assume your rebroadcast is always 1 days later - this mean you need to subtract 1 day to get the original filename.
This can be done by the following macro:

Code: Select all

Show1-*[DATE:{${start}}:{days}:{-1}:{yy-MM-dd}].mp3
This will subtract 1 day from the ${start} value and output it in the format yyyy-MM-dd

Post Reply