Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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
1  
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.