|
|
#1 |
|
Prospect
Join Date: Dec 2007
Posts: 20
|
Applescript for sequentially numbering files??
Anyone know where I can find a script to add a sequential prefix number to files in a folder?
(ie: 01_image.jpeg, 02_otherimage.jpeg, 03_anotherimage.jpeg) |
|
|
|
|
|
#2 |
|
Hall of Famer
Join Date: Dec 2007
Posts: 3,641
|
If you don't require Applescript (of which I'm no help), you may want to consider the donationware Name Mangler since it can number files sequentially.
|
|
|
|
|
|
#3 |
|
Prospect
Join Date: Apr 2009
Posts: 3
|
If an Automator Workflow is OK (vs. an applescript), you can do it by making an Automator Workflow fairly easily. If you really want an Applescript, I can write one for you and paste the required code into a new post.
I will give you a workflow for now, since I can make it faster. I will list in text form what Automator Actions you need to add in the following example action: ========================================================================== TITLE (same as name of action in Automator Library) -------------------------------------------------------------------------- Options: (any description of what you need to configure in the current automator action to make it work correctly.) Here is an Automator Workflow you can try: ========================================================================== ASK FOR FINDER ITEMS -------------------------------------------------------------------------- Options: - Optional: set "start in" folder to a different folder - Check "Allow Multiple Selection" ========================================================================== RENAME FINDER ITEMS -------------------------------------------------------------------------- Note: It is your choice if you want to copy the files before modifying them. If you do, there will be a third action in this workflow, before this one but after the first one shown here. Options: - Set first drop-down box to "Make Sequential" - Click radio button ("circle") next to Add number to existing item name - Set "Place number" to "before name" - Set "start numbers at" to the number you want to start the count at - Set "separated by" to "underscore" (this will insert a "_" after each number) - Optional: if you want the numbers the same length, check "Make all numbers" and set the length. - Look at the example at the bottom to see if the format is correct. Then just run it! When the file selection box shows up, use the shift key to select a continuous list of files, or command to select each file you click. |
|
|
|
|
|
#4 |
|
Prospect
Join Date: Dec 2007
Posts: 20
|
That Name Mangler app is great.
The Automator workflow is what I needed! Thanks I have to use automator more often
|
|
|
|
|
|
#5 |
|
Major Leaguer
Join Date: Mar 2006
Posts: 432
|
I use Automator for this and have a generic 'batch rename' so that I can name files what I want instead of a pre-determined string like Applescript would give.
There is probably a way to add a dialog input to an applescript but I have always found you give it a parameter and it starts from there. Popular ones that I've seen use a timestamp.
__________________
Maybe the light at the end of the tunnel is you. |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|