Showing posts with label OS X. Show all posts
Showing posts with label OS X. Show all posts

Sunday, August 25, 2013

Using Automator to get the absolute path of the selected file or folder in Finder in OS X 10.8.4

This guide shows how you can add a contextual menu (i.e. right click menu) which copies the full path of the selected file or folder to the clipboard.

I often need to report to clients the list of files changed in a project manually. Unlike Windows Explorer or Nautilus in Linux, OS X's Finder requires multiple steps in order to retrieve the absolute path of the currently visible directory. Fortunately, Automator comes to the rescue.

These instructions applies to OS X 10.8.4

1) Open Automator.
2) Click 'Service' then click 'Choose'
3) At the top right, change the drop down lists so they look like :
Service receives selected 'files or folders' in 'Finder'
4) Click 'Utilities'. Drag 'Run Shell Script' to the workflow.
5) For 'Pass input', select 'as arguments'
In the text area, use these :
for f in "$@"
do
 echo "$f"
 # echo "'$f'"
done
6) Click 'Utilities'. Drag 'Copy to Clipboard' to the workflow. Drop it at position 2.
7) Click 'File', 'Save'.
8) Give it a name like 'Copy path'.
9) You will now have an entry called 'Copy path' in your Finder contextual menu i.e. the right click menu.

Thursday, January 31, 2008

How to eject CD drive in OS X

Press F12 for a few seconds.

Then (hopefully) your CD (or DVD) drive will eject.

Wait, why is this considered "not in the manual" ?

Well, today I had to insert a DVD into my optical drive but its physical eject button was not working anymore.

Since I was booted into OS X at the time, I decided to look around for any sign of said optical drive.

But no. Nada. Zip.



This simple & intuitive task in Windows & Linux proved to be surprisingly complicated in OS X. Funny (well ... not at the time though).

So, I went to the Terminal and typed :


eject /dev/cdrom


It replied saying "eject" wasn't found. True enough, the following returned zilch :


find / -name 'eject' -print


Finally succumbed and Googled instead. Then stumbled upon the F12 trick.

Of course once the optical drive isn't empty, then only Finder displays it as a mounted drive !



This, from a premium priced boutique OS :/

I have other gripes concerning OS X but I'll save it for later (... the fan boys are everywhere)