Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In Mac, with Xee, from command line, how to open image in its original size?

The reason I need this is to script the process.

share|improve this question
up vote 2 down vote accepted

Add this function to your ~/.bash_profile. Save the file, then reload your shell.

function xee() {
open -a "Xee" "$1"
osascript -e 'tell application "System Events" to keystroke "0" using command down'

Then call it with:

xee ~/path/to/image.jpg

Feel free to remix this into a proper AppleScript .scpt file using Automator or similar. Depending on the speed of Xee launching, you might want to add a delay between opening Xee and the UI automation (from osascript).

share|improve this answer
It does NOT open the image file with its original size. – qazwsx Mar 22 '12 at 0:06
What happens instead? It works for me. You do mean the Actual Size option from View? – slhck Mar 22 '12 at 7:35
If the image is larger then the screen size, your script opens the image with a zoom level such that it fills the height. This was the main problem I wanted to solve: automatically opening the image in original size. – qazwsx Mar 23 '12 at 15:19
If Xee is incapable of doing that, what lightweight image viewer can do it on Mac OS X? I potentially need to open/close images several hundred times a day. So I really need the app to be a light weight one, i.e. starts/closes fast. – qazwsx Mar 23 '12 at 15:20
It presses the Actual Size option from the View menu in Xee. It renders the image in its original size. I still don't understand you — what do you need instead? – slhck Mar 23 '12 at 17:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .