Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: timestamp %added% only for files without this tag? (Read 5555 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

timestamp %added% only for files without this tag?

i want to timestamp my files with the tag ADDED when added to db but only if this tag dont exist, so i did following mass tagger script:

Code: [Select]
Time Stamp: NoW
Format "ADDED" using "$if($greater($len(%ADDED%),5),%ADDED%,%NOW%)"
Remove "NOW"


and added this to new files tagger. seems to be ok, doesnt it?


but it doesnt worked, cause i did a fault:
*external hdd wasnt plugged in
*update db --> all files from external hdd deleted from db
* plugged in external hdd
*update db --> all files are added to db and also get currend date/time as added stamp

so maybe someone now a better way to detect if %ADDED% exist and dont overwrite it then?!?

timestamp %added% only for files without this tag?

Reply #1
This is what i use. Should work.

Code: [Select]
Time Stamp: DATE ADDED_TEMP
Format "DATE ADDED" using "$if(%DATE ADDED%,%DATE ADDED%,%DATE ADDED_TEMP%)"
Remove "DATE ADDED_TEMP"


If there is already DATE ADDED tag. it will format from itself and romove new time stamp (DATE ADDED_TEMP).

If not, it will format from DATE ADDED_TEMP then delete them.

timestamp %added% only for files without this tag?

Reply #2
so $if2(%DATE ADDED%,%DATE ADDED_TEMP%) should also work?

if a tag exists, it returns true and if it not exists it returns false, right?

timestamp %added% only for files without this tag?

Reply #3
yes.

timestamp %added% only for files without this tag?

Reply #4
i know what I was doing wrong... I was doing guess instead of format for the comparison hence it didnt work.. now it works a charm!!!

thx guys

timestamp %added% only for files without this tag?

Reply #5
One question. Why do you create a temp-tag first and delete it later?

Maybe I'm wrong, but isn't this possible and delivers the same result?
Code: [Select]
Format "DATE ADDED" using "$if2(%DATE ADDED%,%cwb_systemdate%)"

timestamp %added% only for files without this tag?

Reply #6
Masstagger doesn't recognize %cwb_systemdate%

Sorry, Just saw this.