How to monitor a folder for changes

OS X comes with somewhat of a hidden feature straight out of the box. That’s the ability to fire AppleScripts on folder actions. Those actions could be anything from files being added, changed or deleted from a folder.

This can be handy if you need notification of when a file has finished downloading or need to rotate log files etc.

AppleScript is a powerful language, which to the beginner may even seem quite daunting. Luckily there’s a script all ready and waiting which notifies you of folder changes.

To switch on this feature, navigate to the folder you’d like to monitor. Now pull up the context menu (right click) and select folder actions setup.

Folder Actions

 

From here select the ‘add – new item alert.scpt’

Add Item

Once added, you have the opportunity to modify the Apple Script should you wish. If you are happy with the notification popup, simply close down the open windows and wait..

That’s all there is to it really, if you need something a little more advanced, you’ll have to break open the AppleScript editor. Or post a response below, and I’ll post a tutorial on how to do what you need!

Read More

Speed up media folder navigation

20121102-220141.jpg
One of the most used features on my OS X installs is the Quick Look feature, its much easier then launching an app just to check, or to quickly read off its content. However, for as long as I can remember Quick Look has always been known for causing delays in folder navigation, high CPU and high network utilisation. This is generally down to it rendering previews of movie files in the active finder window. Yes – this even includes items on your desktop.

There are a couple of ways to combat this speed delay without loosing functionality of Quick Look on other files.

The easiest is to remove the Quick Look generator from the quick look folder. To do this, click on Go > Go To Folder now type or copy paste /System/Library/QuickLook/ now either delete or if you’d prefer move Movie.qlgenerator to another location.

This will disable the thumbnails for movie files, and speed up finder navigation – especially for media heavy folders.

Read More

Unhide the Library folder in Finder – AppleScript

By default the ‘Library’ folder is a hidden folder in OS X Finder. However, if you need temporary (GUI) access you can use this simple AppleScript below to remove the ‘hidden’ flag from the folder.

tell application "System Events"
	set libvis to (get visible of folder "~/Library")
end tell

if libvis = false then --~/Library is currently invisible
	tell application "System Events" to set visible of folder "~/Library/" to true
else --~/Library is visible
	tell application "System Events" to set visible of folder "~/Library/" to false
end if

This script could also be easily amended to show and hide any folder of your choice, simply by replacing the ~/Library/ with the path of the folder you’d like to toggle.

Read More

Launch finder as root

Sometimes theres a need to dig around in the OS X file system without restriction, (which also means without protection) for example should you need access to files or folders, but don’t fancy switching permissions or playing with complex terminal commands.

Using the single lined command below in terminal you can launch an instance of finder which doesn’t hold any of the restrictions that your normal finder window holds.

Bear in mind this will also give you the ability to cause serious damage to your file system, should you go messing with things you shouldn’t.

Copy and paste the following into a terminal window and press return.

You will be prompted for your password, then a new finder instance should launch. It it doesn’t you should see a second set of icons overlaying your desktop icons. Double click the ‘root’ icon, and it should launch finder as root.

Remember boys and girls.. Be careful in there!

Read More