Batch Renaming Folders

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
2
down vote

favorite
1












Is there a way to batch replace current folder names with increasing numbers? The "Rename Finder Items" built-in feature only lets you replace in the 'Find and replace text' kind of way. Not all my current folder names have common characters.
I'm using Mojave, btw.












share|improve this question









New contributor




usuallystuck is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



















  • You could try and do it with a bash script. As noted here unix.stackexchange.com/questions/216659/… I like @eapo's solution.
    – user136952
    2 hours ago















up vote
2
down vote

favorite
1












Is there a way to batch replace current folder names with increasing numbers? The "Rename Finder Items" built-in feature only lets you replace in the 'Find and replace text' kind of way. Not all my current folder names have common characters.
I'm using Mojave, btw.












share|improve this question









New contributor




usuallystuck is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



















  • You could try and do it with a bash script. As noted here unix.stackexchange.com/questions/216659/… I like @eapo's solution.
    – user136952
    2 hours ago













up vote
2
down vote

favorite
1









up vote
2
down vote

favorite
1






1





Is there a way to batch replace current folder names with increasing numbers? The "Rename Finder Items" built-in feature only lets you replace in the 'Find and replace text' kind of way. Not all my current folder names have common characters.
I'm using Mojave, btw.












share|improve this question









New contributor




usuallystuck is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











Is there a way to batch replace current folder names with increasing numbers? The "Rename Finder Items" built-in feature only lets you replace in the 'Find and replace text' kind of way. Not all my current folder names have common characters.
I'm using Mojave, btw.









macos finder folders mojave rename






share|improve this question









New contributor




usuallystuck is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




usuallystuck is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 1 hour ago









Tetsujin

55.8k1585175




55.8k1585175






New contributor




usuallystuck is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 2 hours ago









usuallystuck

162




162




New contributor




usuallystuck is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





usuallystuck is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






usuallystuck is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











  • You could try and do it with a bash script. As noted here unix.stackexchange.com/questions/216659/… I like @eapo's solution.
    – user136952
    2 hours ago

















  • You could try and do it with a bash script. As noted here unix.stackexchange.com/questions/216659/… I like @eapo's solution.
    – user136952
    2 hours ago
















You could try and do it with a bash script. As noted here unix.stackexchange.com/questions/216659/… I like @eapo's solution.
– user136952
2 hours ago





You could try and do it with a bash script. As noted here unix.stackexchange.com/questions/216659/… I like @eapo's solution.
– user136952
2 hours ago











2 Answers
2






active

oldest

votes

















up vote
2
down vote



accepted










Select all the folders you want to rename, right click them and select "Rename [number] Items..."



When you use the "Rename Finder Items" feature, you have to change it from "Replace Text" to "Format" in the drop down menu:



enter image description here



Now you can rename it however you want:



enter image description here



(I'll add better images later)






share|improve this answer





























    up vote
    2
    down vote













    Here is an AppleScript solution that is quite efficient. You can save this code in script editor.app as an application.



    set newName to 0
    set theFolder to (choose folder with prompt "Choose Folder" with invisibles)

    tell application "Finder"
    set theFolders to folders of theFolder
    set sortedFolders to sort theFolders by name
    repeat with i from 1 to count of sortedFolders
    set newName to newName + 1
    set thisItem to item i of sortedFolders
    set name of thisItem to newName
    end repeat
    end tell


    enter image description here



    If you would prefer the single digit folder names to appear as double digit (01,02,03 etc.), use this following version of the script instead



    set newName to 0
    set theFolder to (choose folder with prompt "Choose Folder" with invisibles)

    tell application "Finder"
    set theFolders to folders of theFolder
    set sortedFolders to sort theFolders by name
    repeat with i from 1 to count of sortedFolders
    set newName to newName + 1
    set thisItem to item i of sortedFolders
    if newName is less than 10 then
    set name of thisItem to 0 & newName as string
    else
    set name of thisItem to newName
    end if
    end repeat
    end tell





    share|improve this answer






















      Your Answer







      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "118"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      convertImagesToLinks: false,
      noModals: false,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );






      usuallystuck is a new contributor. Be nice, and check out our Code of Conduct.









       

      draft saved


      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fapple.stackexchange.com%2fquestions%2f340335%2fbatch-renaming-folders%23new-answer', 'question_page');

      );

      Post as a guest






























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      2
      down vote



      accepted










      Select all the folders you want to rename, right click them and select "Rename [number] Items..."



      When you use the "Rename Finder Items" feature, you have to change it from "Replace Text" to "Format" in the drop down menu:



      enter image description here



      Now you can rename it however you want:



      enter image description here



      (I'll add better images later)






      share|improve this answer


























        up vote
        2
        down vote



        accepted










        Select all the folders you want to rename, right click them and select "Rename [number] Items..."



        When you use the "Rename Finder Items" feature, you have to change it from "Replace Text" to "Format" in the drop down menu:



        enter image description here



        Now you can rename it however you want:



        enter image description here



        (I'll add better images later)






        share|improve this answer
























          up vote
          2
          down vote



          accepted







          up vote
          2
          down vote



          accepted






          Select all the folders you want to rename, right click them and select "Rename [number] Items..."



          When you use the "Rename Finder Items" feature, you have to change it from "Replace Text" to "Format" in the drop down menu:



          enter image description here



          Now you can rename it however you want:



          enter image description here



          (I'll add better images later)






          share|improve this answer














          Select all the folders you want to rename, right click them and select "Rename [number] Items..."



          When you use the "Rename Finder Items" feature, you have to change it from "Replace Text" to "Format" in the drop down menu:



          enter image description here



          Now you can rename it however you want:



          enter image description here



          (I'll add better images later)







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 1 hour ago

























          answered 2 hours ago









          abc

          2,1072936




          2,1072936






















              up vote
              2
              down vote













              Here is an AppleScript solution that is quite efficient. You can save this code in script editor.app as an application.



              set newName to 0
              set theFolder to (choose folder with prompt "Choose Folder" with invisibles)

              tell application "Finder"
              set theFolders to folders of theFolder
              set sortedFolders to sort theFolders by name
              repeat with i from 1 to count of sortedFolders
              set newName to newName + 1
              set thisItem to item i of sortedFolders
              set name of thisItem to newName
              end repeat
              end tell


              enter image description here



              If you would prefer the single digit folder names to appear as double digit (01,02,03 etc.), use this following version of the script instead



              set newName to 0
              set theFolder to (choose folder with prompt "Choose Folder" with invisibles)

              tell application "Finder"
              set theFolders to folders of theFolder
              set sortedFolders to sort theFolders by name
              repeat with i from 1 to count of sortedFolders
              set newName to newName + 1
              set thisItem to item i of sortedFolders
              if newName is less than 10 then
              set name of thisItem to 0 & newName as string
              else
              set name of thisItem to newName
              end if
              end repeat
              end tell





              share|improve this answer


























                up vote
                2
                down vote













                Here is an AppleScript solution that is quite efficient. You can save this code in script editor.app as an application.



                set newName to 0
                set theFolder to (choose folder with prompt "Choose Folder" with invisibles)

                tell application "Finder"
                set theFolders to folders of theFolder
                set sortedFolders to sort theFolders by name
                repeat with i from 1 to count of sortedFolders
                set newName to newName + 1
                set thisItem to item i of sortedFolders
                set name of thisItem to newName
                end repeat
                end tell


                enter image description here



                If you would prefer the single digit folder names to appear as double digit (01,02,03 etc.), use this following version of the script instead



                set newName to 0
                set theFolder to (choose folder with prompt "Choose Folder" with invisibles)

                tell application "Finder"
                set theFolders to folders of theFolder
                set sortedFolders to sort theFolders by name
                repeat with i from 1 to count of sortedFolders
                set newName to newName + 1
                set thisItem to item i of sortedFolders
                if newName is less than 10 then
                set name of thisItem to 0 & newName as string
                else
                set name of thisItem to newName
                end if
                end repeat
                end tell





                share|improve this answer
























                  up vote
                  2
                  down vote










                  up vote
                  2
                  down vote









                  Here is an AppleScript solution that is quite efficient. You can save this code in script editor.app as an application.



                  set newName to 0
                  set theFolder to (choose folder with prompt "Choose Folder" with invisibles)

                  tell application "Finder"
                  set theFolders to folders of theFolder
                  set sortedFolders to sort theFolders by name
                  repeat with i from 1 to count of sortedFolders
                  set newName to newName + 1
                  set thisItem to item i of sortedFolders
                  set name of thisItem to newName
                  end repeat
                  end tell


                  enter image description here



                  If you would prefer the single digit folder names to appear as double digit (01,02,03 etc.), use this following version of the script instead



                  set newName to 0
                  set theFolder to (choose folder with prompt "Choose Folder" with invisibles)

                  tell application "Finder"
                  set theFolders to folders of theFolder
                  set sortedFolders to sort theFolders by name
                  repeat with i from 1 to count of sortedFolders
                  set newName to newName + 1
                  set thisItem to item i of sortedFolders
                  if newName is less than 10 then
                  set name of thisItem to 0 & newName as string
                  else
                  set name of thisItem to newName
                  end if
                  end repeat
                  end tell





                  share|improve this answer














                  Here is an AppleScript solution that is quite efficient. You can save this code in script editor.app as an application.



                  set newName to 0
                  set theFolder to (choose folder with prompt "Choose Folder" with invisibles)

                  tell application "Finder"
                  set theFolders to folders of theFolder
                  set sortedFolders to sort theFolders by name
                  repeat with i from 1 to count of sortedFolders
                  set newName to newName + 1
                  set thisItem to item i of sortedFolders
                  set name of thisItem to newName
                  end repeat
                  end tell


                  enter image description here



                  If you would prefer the single digit folder names to appear as double digit (01,02,03 etc.), use this following version of the script instead



                  set newName to 0
                  set theFolder to (choose folder with prompt "Choose Folder" with invisibles)

                  tell application "Finder"
                  set theFolders to folders of theFolder
                  set sortedFolders to sort theFolders by name
                  repeat with i from 1 to count of sortedFolders
                  set newName to newName + 1
                  set thisItem to item i of sortedFolders
                  if newName is less than 10 then
                  set name of thisItem to 0 & newName as string
                  else
                  set name of thisItem to newName
                  end if
                  end repeat
                  end tell






                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited 45 mins ago

























                  answered 1 hour ago









                  wch1zpink

                  2,589417




                  2,589417




















                      usuallystuck is a new contributor. Be nice, and check out our Code of Conduct.









                       

                      draft saved


                      draft discarded


















                      usuallystuck is a new contributor. Be nice, and check out our Code of Conduct.












                      usuallystuck is a new contributor. Be nice, and check out our Code of Conduct.











                      usuallystuck is a new contributor. Be nice, and check out our Code of Conduct.













                       


                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fapple.stackexchange.com%2fquestions%2f340335%2fbatch-renaming-folders%23new-answer', 'question_page');

                      );

                      Post as a guest













































































                      Comments

                      Popular posts from this blog

                      Long meetings (6-7 hours a day): Being “babysat” by supervisor

                      Is the Concept of Multiple Fantasy Races Scientifically Flawed? [closed]

                      Confectionery