Advertisement
Guest User

AR Script: use the name of the first file in all others

a guest
Jan 31st, 2017
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.   // Number of characters for the counter, padded with zeros if needed
  2.   ZERO_PADDING = 3;
  3.  
  4.   if (index != 0){  return app.getItem(0).name + "_" + zpad(index.toString(), ZERO_PADDING); }
  5.  
  6. // Function that add leading zeros to any string
  7. function zpad(str, nb_digits) {
  8.     if (str.length < nb_digits)     { return (Array(nb_digits - str.length + 1).join('0') + str); }
  9.     else                            { return str; }
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement