AppleScripting Evernote > Embedded Image Scaler
I'm a big fan of Evernote. I use it for archiving ideas, writing articles / blog posts and lots more. I often insert screenshots and other large images into my notes. Screenshots can be pretty big, and I usually don't want giant images filling up my notes. I keep wishing Evernote offered a way to resize embedded images, so I could insert thumbnails. At the moment, it doesn't. So, I decided to write my own app to resize embedded images. Here's how you can do the same...
Creating the Script App
My script app uses Image Events, a background app in OS X, to do the scaling. So, no third-party software (other than Evernote) is needed for this to work.
Note: If you have any trouble following along, don't worry, you can download the complete script app here.
1. Launch AppleScript Editor and create a new script document containing the following script:
If you're familiar with AppleScript, then you'll notice this script uses an open handler, making it a droplet. When triggered to process an embedded image in an Evernote note, the image is actually passed as if it was dropped on the script app.
2. Save the script as an application named Evernote > Scale Embedded Images to your Applications folder or another folder of your choice.
3. Go to the saved script app and Control+Click on it to reveal the Finder's contextual menu. Choose Show Package Contents to view the contents of the saved app bundle.
4. Navigate to the Contents folder within the script's bundle and open the Info.plist file in TextEdit, TextWrangler or your other favorite text editor.
5. Change the CFBundleDocumentTypes key's array to the following:
This Info.plist change sets the script app to only accept JPEGs, PNGs and TIFFs, and for the script app to appear as an image editor. Image Events can process other types of images too, including BMP, GIF, PSD and PICT. So, if you think you may be embedding those types of images in your notes, go ahead and add extensions for them too.
6. Save and close the edited Info.plist.
You're done. The script app is ready for use.
Resizing Embedded Images in Evernote
Please note that your script app scales embedded images in Evernote notes. When an image is scaled, you can't revert back to the unscaled version. So, be pretty darn sure you want to scale an image before triggering the script.
1. Open an Evernote note containing an embedded image.
2. Control+Click on an embedded image and choose Open With. You should see your script app in the list of supported apps. Choose Evernote > Scale Embedded Images.
Evernote launches the script app and passes it the selected embedded image.
3. When prompted, choose the desired size. Options are Low (320px on the longest side), Medium (640px) or High (1280px). Or, you can select Custom to enter another size.
The script opens the embedded image, scales it accordingly and saves it. Evernote detects that the image has been changed, and updates the note to reflect the new scaled version.
Congratulations, you've just expanded Evernote's feature set. Anytime you want a smaller version of an embedded image, your script app is ready to help. Also, while this script is intended for Evernote, you can use it outside of Evernote too. Just drag and drop JPEGs, PNGs or TIFFs onto the script app to scale them too. Until next time, happy scripting!
Subscribe to Newsletter
Software Updatesmore updates
- Pandora Radio 5.1: Wake up to your favorite station
- Microsoft revamps Bing for iPad
- Plex updated for iOS 7
- Readdle rolls out PDF Expert 5: iCloud support, shared folder with Documents by Readdle
- FlightTrack 5: new look and features just in time for holiday travel
- HBO Go for iOS update adds Google Chromecast support