lets check if the current file from our list (based on index-number) has even any file-extension if new_extension is "" then - "" means there is no file-extension present. Set index_prefix to "0" else set index_prefix to "" if the index number is lower than 10, we will add a preceding "0" for a proper filename sorting later using our index, we select the appropriate file from our list set this_file to item indexof all_files Repeatwithindexfrom1to the countof all_files the ’index’ number is of course required for the sequential renaming of our files! ’index’ is our counter that we initially set to 1 and then count up with every file. now we start looping through all selected files. Settext item delimiters to "." tell application "Finder" set all_files to every item of (choosefilewithprompt "Choose the Files you’d like to rename:" with multiple selections allowed ) aslistĭisplay dialog "New file name:" default answer "" set new_name totext returned ofresult
0 Comments
Leave a Reply. |