Avatar

Level 1

The file name has a prefix of tmp.  I need to remove the prefix from the name.  I was trying to use the split and join method to break up the name and rejoin it again with out the tmp.  But I'm not sure these commands work in Adobe.  Below is the code I have written so far.  What am I doing wrong?

 

logInfo(vars.filename);

 

vars.nameOnly = vars.filename.rmdir();

vars.f1 = vars.nameOnly.split("_");

vars.f2 = f1.shift();

vars.finalName = f2.join("_");

 

logInfo(vars.finalName);

 

vars.cmd = path + vars.finalName;

 

execCommand(cmd);