#1 : 03/05-15 01:42 Sailor Guy
Posts: 40
|
I am writing some Javascript in a Script method for the first time. I have developed VB and PowerShell code before so I'm not a complete neophyte with writing code.
Is there a JS development / debugging environment where I can single-step through the script code, display item properties, trace execution, etc.? Is there a way to call an AR method from inside a JS script? Is there a forum or support location that has sample AR scripts to look at? Thanks in advance, Sailor Guy |
#2 : 06/05-15 19:53 Kim Jensen
Administrator
Posts: 883 |
Reply to #1:
The javascript debugging tools in AR is very limited - read not existing. I will recommend using rather small scripts and only advance slowly and keep looking at the ouput in the new name column of Advanced Renamer. TIP: Try typing App. There are a couple of useful methods on the App object. |
#3 : 08/05-15 14:55 Sailor Guy
Posts: 40
|
I found a simple "debugging" trick for seeing the result or value of a variable or formula...
Return the variable or formula on the function Return script command. For example with this little code script... --------------------------------------------------------------------------------------------- var sVideoExtList = ".avi .mov .mp4 .mpg"; if (sVideoExtList.search(item.ext.toLowerCase()) > -1) { sNewName = sNewName.replace("-", "v-"); } iSeqNum = iSeqNum + 1; // increment file seq number counter --------------------------------------------------------------------------------------------- To see the numeric result of the .search command... return sVideoExtList.search(item.ext.toLowerCase(); To see the iSeqNum value... return iSeqNum; |
#4 : 08/05-15 15:04 Sailor Guy
Posts: 40
|
Kim,
I don't understand your comment... "TIP: Try typing App. There are a couple of useful methods on the App object." Where do I find the App object? Also, can you call your methods from inside a JS script? If so, how? Thanks, Sailor Guy |
#5 : 19/05-15 23:08 Kim Jensen
Administrator
Posts: 883 |
Reply to #4:
Sorry, it is not App but app. Try this: app.parseTags('<Name>') This will parse the tag and return the result as a string. The parameter can be any pattern including any number of tags. |