Skip to main content

Batch renaming of files in OSX using Automator

While I was organizing my photos, I encountered many instances where the filenames of different photos were the same, so I couldn't place them in the same folder without renaming them. It was fine at first when there only a handful of duplicate filenames, but there had to be better way. There was another scenario where I wanted to insert the year before each video so that I could easily group them.

In OSX, there is a built-in tool called Automator, which is found in Applications. Just open it and create an Application. When it opens, just search for rename and drag "Rename Finder Items" to the main window, which will ask you if you want a copy or not. In my case, I did not need a copy. You can change the parameters to something like below. Then save it to your Desktop for easy access.
Inserts the year in front of the files.
To use this, in Finder, select the files you wish to rename and drag them to the Automator icon that you just saved in your Desktop. I have two such icons handy: Append isodate and Prepend Year. After dragging the files from Finder to the Automator icon, your files will have been renamed.


Comments

Popular posts from this blog

iReport Default Date Parameter

If you want to set a default date for a jasperreports parameter, you can enter the following in the default value expression of the parameter. new Date() However, if you wanted the default to be relative from today, for example, 3 days ago, you will need to do go outside of the standard java date libraries (Date, Calendar) because JR parameter does not allow you to have multiple statements. You can write your own utility package or you can use Joda , a replacement library for the JDK date and time library. To use Joda in iReports, you need to extract the jar file and add it to Options -> Classpath. You may also drop the jar file in iReports' lib directory. You will also need to add this library to your application or report server. For setting a default date 5 days prior from today, use this: new org.joda.time.DateTime().minusDays(5).toDate() or this if you want the time part set to the beginning of the day: new org.joda.time.LocalDate().toDateTimeAtStartOfDay().minusDays(5).to...

Get uptime alerts in Telegram

You will be configuring 3 services. The assumption is that you have accounts already for these services. UptimeRobot — source of the uptime/downtime notifications. It currently supports email, Twitter, Slack, Pushover, Pushbullet and others but not Telegram. We will use the webhook notification as the way to send messages to Telegram. IFTTT — bridges UptimeRobot and Telegram by providing the webhook for UptimeRobot and triggering a message to Telegram. In IFTTT terminology: IF {event trigger from UptimeRobot}, then {send message to Telegram group} Telegram — destination of the notification. You will need to create a group for this. Telegram Configuration In Telegram, create a new group, if needed. You may opt to use an existing group. Go to @IFTTT and follow the instruction so link your Telegram account to your IFTTT account. Send /connect_group to @IFTTT and connect the group where you want to send the notifications. IFTTT Configuration Sign in to IFTTT and add a ne...

Oracle Apps on Mozilla Firefox

You actually don't need to install JInitiator (jinit 1.3.1.21) to run Oracle Applications on Firefox if you already installed the Sun JRE 1.4.2 and above. You will need to edit pluginreg.dat On Windows, that file is located at %APPDATA%\Mozilla\Firefox. Make a copy of the existing one first in case something goes wrong. Search for NPJava14.dll because Oracle runs on Java 1.4. This will appear whether you have installed Java 5 or 6. You will need to add the following line to at the end of the plugins. 6|application/x-jinit-applet;version=1.3.1.21|Java||$ Then update the count at the top of the section. Your modified pluginreg.dat will look like: C:\Program Files\Java\jre1.5.0_09\bin\NPJava14.dll|$ |$ 1160594743000|1|5|$ Java Plug-in 1.5.0_09 for Netscape Navigator (DLL Helper)|$ Java(TM) 2 Platform Standard Edition 5.0 Update 9|$ 7 0|application/x-java-applet;version=1.4.2|Java Applet||$ 1|application/x-java-bean;version=1.4.2|JavaBeans||$ 2|application/x-java-applet;version=1.4.1|J...