DESKTOP

Automate Tasks with Folder Actions

11/19/2012 9:05:33 AM

With this amazing OS X tool, a folder isn't just a folder.

With the handy Folder Actions feature of OS X, you can attach AppleScripts to specific folders, set to run whenever someone adds files to the folders.

Description: Description: Description: Automate Tasks with Folder Actions
Automate tasks with Folder Actions

That means the scripts can trigger an alert whenever new files are added to a specific folder, change the Finder labels when you put files in a folder, and automatically unzip file archives. Here’s how Folder Actions work:

Explore other built-in actions

OSX includes a handful of folder action scripts in the /Library/Scripts/Folder Action Scripts folder.

For example, a number of scripts can act on graphics - there are three that can convert image files to JPEG, PNG or TIFF format. Let’s say you have a blog, and you want all your graphics to be in JPEG format. Create a folder and attach the ‘image - Duplicate as JPEG.scpt’ script to it. Every time you add an image file to that folder, the file immediately gets converted.

Description: Description: Description: All your Folder Actions
All your Folder Actions, in this window, you can see all folders that have Folder Actions attached to them, and which scripts they are set to run.

There’s also a nifty script you can use if you often open a lot of folders within a specific folder. Closing all those windows when you’ve finished with them can be annoying. Attach the ‘close -close subfolders.scpt’ script to a folder, and any open subfolders get closed when you close the top-level folder. This is useful for projects that require you to access files in many subfolders.

Turn on folder actions globally

To use Folder Actions, you must first turn this feature on globally. To do so, Control click (or right click) any folder and choose Services > Folder Actions Setup.

(If you only have a few Services, you may not have a Services menu and will instead see the Folder Actions Setup menu item at the bottom of the contextual menu.) When you choose Folder Actions Setup, a small window opens showing a list of AppleScripts. Select Enable Folder Actions in the window, and then quit.

Get alerted to incoming files

If you share files with other people over a network, your colleagues may deposit files in your Mac’s built-in Drop Box folder. (Not to be confused with the cloud storage service Dropbox.) For how to doing this, see the Apple support document support.apple.com/ kb/PH 10640.

But how do you know when a new file has arrived? Add a Folder Action that displays a dialogue box whenever a new file is added to your Drop Box.

To do this, first go to your Public folder. You’ll find it inside your home folder -the one with the house icon. (Or, in the Finder, select Go > Go To Folder and type —/Public). Control-click (or right-click) the Drop Box folder that’s inside this folder, choose Folder Actions Setup, click ‘add - new item alert.scpt’ and click Attach.

Let’s try this out. Place any file inside this folder. Within a few seconds, you should see a dialogue box telling you how many new items were added to the folder and asking if you would like to view these items. Click Yes to open a window showing the files, or click No to dismiss the dialogue box. You may not need to see the files right away, but now you know that they have been added.

Another way to use this same script is with your own Dropbox folder (part of the backup and file synchronization service at www.dropbox.com). If you share files using Dropbox’s shared folders, you may want to know when you receive new files.

Dropbox offers desktop notifications-            floating alerts - but they fade away after a few seconds. Attach the same script we used above to a shared Dropbox folder, and you’ll see an alert whenever someone downloads new files to that folder

Description: Description: Description: Drop Box alert
Drop Box alert. Once you attach the Folder Action to your Drop Box folder, you'll see an alert like this every time someone puts something in the folder

Note that this only works when you add an item to the folder itself, not when you add an item to one of its subfolders. If you have a lot of subfolders in your shared folder, you'll need to apply the same script to each of them to get alerts for all of the folders.

Turn off folder actions

If you ever want to turn off Folder Actions for specific folders, you can access the Folder Actions Setup applet as described above by Control-clicking (or right-clicking) any folder.

Dismiss the list of scripts, and you see a list of folders for which you’ve set Folder Actions, along with which scripts you’ve attached to them. Turn off any of these by unchecking them, or delete any folder or script from the list by selecting it and clicking the minus-sign (-) button.

Other  
 
Top 10
Review : Sigma 24mm f/1.4 DG HSM Art
Review : Canon EF11-24mm f/4L USM
Review : Creative Sound Blaster Roar 2
Review : Philips Fidelio M2L
Review : Alienware 17 - Dell's Alienware laptops
Review Smartwatch : Wellograph
Review : Xiaomi Redmi 2
Extending LINQ to Objects : Writing a Single Element Operator (part 2) - Building the RandomElement Operator
Extending LINQ to Objects : Writing a Single Element Operator (part 1) - Building Our Own Last Operator
3 Tips for Maintaining Your Cell Phone Battery (part 2) - Discharge Smart, Use Smart
REVIEW
- First look: Apple Watch

- 3 Tips for Maintaining Your Cell Phone Battery (part 1)

- 3 Tips for Maintaining Your Cell Phone Battery (part 2)
VIDEO TUTORIAL
- How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010 (Part 1)

- How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010 (Part 2)

- How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010 (Part 3)
Popular Tags
Video Tutorail Microsoft Access Microsoft Excel Microsoft OneNote Microsoft PowerPoint Microsoft Project Microsoft Visio Microsoft Word Active Directory Exchange Server Sharepoint Sql Server Windows Server 2008 Windows Server 2012 Windows 7 Windows 8 Adobe Flash Professional Dreamweaver Adobe Illustrator Adobe Photoshop CorelDRAW X5 CorelDraw 10 windows Phone 7 windows Phone 8 Iphone
Visit movie_stars's profile on Pinterest.