Scrippting: how to use "Insert Tag" feature?

Advanced Renamer forum
#1 : 19/06-13 12:25
Stefan
Stefan
Posts: 274
For example

Script method > right click context menu > Insert Tag > <Filesize>


How can I use "<Filesize>" in a script?


X = <Filesize>;
return item.newBasename + ' ' + X;




 


19/06-13 12:25
#2 : 23/06-13 18:13
NomenEtOmen
NomenEtOmen
Posts: 29
Reply to #1:
hm,

maybe the functions can only get with a method of item like in this script:



/**
adds filesize to the filename
**/
var oName = item.name; //original name
var nName = "" ; //new name
var sSep = "." ; //the separator for concatenation


nName = oName + sSep + item.size + "Byte"


//script-end: new name
return nName;


23/06-13 18:13 - edited 23/06-13 18:15
#3 : 23/06-13 20:05
Kim Jensen
Kim Jensen
Administrator
Posts: 878
Reply to #1:
You can use the parseTags method on the app object like this:

return app.parseTags("<Filesize>");


The argument passed to parseTags can be anything you would normally use in the New Name method. This is perfectly valid:

return app.parseTags("<Name>_size-<Filesize>");


23/06-13 20:05
#4 : 24/06-13 13:47
Stefan
Stefan
Posts: 274
Reply to #3:


ahhh, app.parseTags("<Filesize>");


Thanks. I was not aware that there is "app." too.

I always try "item." only to get a list what is possible.




Are there more than item. and app. ?





.


24/06-13 13:47 - edited 24/06-13 13:49
#5 : 24/06-13 20:50
Kim Jensen
Kim Jensen
Administrator
Posts: 878
Reply to #4:
The only two Advanced Renamer based objects are item and app. I understand why you didn't know about the app object. It is not mentioned anywhere in the user guide :-/.


24/06-13 20:50