Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I set up a wireless HP Printer for my mother, prints and scans just fine. The annoying thing is that every single time we try to scan in Preview, we first have to do the following:

  1. Select File > Import from Scanner > Include Networked Devices
  2. Select File > Import from Scanner > Printer name

Is there a way to avoid having to do that first step every time? Didn't see a preference in Preview and obviously we aren't going to keep it running all of the time. :)

share|improve this question

2 Answers 2

That answer is very well done, but an even better option is to use "image capture".

share|improve this answer
tell application "Preview"
    activate
end tell

tell application "System Events"
    tell process "Preview"
        tell menu bar 1
            tell menu bar item "File"
                tell menu "File"
                    tell menu item "Import from Scanner"
                        tell menu "Import from Scanner"
                            click menu item "Include Networked Devices"
                            -- added a delay because the list of networked printers doesn't appear immediately. AH 11/21/11
                            repeat until menu item "Printer name" exists
                            end repeat
                            click menu item "Printer name"
                        end tell
                    end tell
                end tell
            end tell
        end tell
    end tell
end tell

To use this, copy the script, open the the Script Editor application under /Applications/AppleScript/, and paste into a new script. I am going to guess that click menu item "Printer name" will have to be changed as I don't think the menu item really says "Printer name", I'm guessing it says something like "HP OfficeJet 6500". Make sure that all menu names match.

Save the script as either an application, which can be launched from the dock, or a script, which can be run from the AppleScript menu bar item.

Note, I believe that you must enable "Enable access for assistive devices" in the "Universal Access" preference pane of System Preferences for this to work:

Enable access for assistive devices

share|improve this answer

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.