• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Hotkeys to Snapz Pro or Grab
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Hotkeys to Snapz Pro or Grab


  • Subject: Re: Hotkeys to Snapz Pro or Grab
  • From: Barry Wainwright <email@hidden>
  • Date: Fri, 11 Feb 2005 09:09:14 +0000

This will get a screen grab without using either Snapz Pro or Grab:

set tempDirectory to POSIX path of (path to temporary items from user
domain)
set inputFile to tempDirectory & "screencapture.pdf"
do shell script "screencapture -i " & inputFile

If required, the PDF file can be converted to a png file with this script:

set outputFile to tempDirectory & "screencapture.png"
tell application "Image Events"
    set theImage to open file (inputFile as string)
    save theImage as PNG in file outputFile without icon
    close theImage
end tell

Other options for screencapture are:

usage: screencapture [-icmwsWx] [file]
  -i      capture screen interactively, by selection or window
            control key - causes screen shot to go to clipboard
            space key   - toggle between mouse selection and
                          window selection modes
            escape key  - cancels interactive screen shot
  -c      force screen capture to go to the clipboard
  -m      only capture the main monitor, undefined if -i is set
  -w      only allow window selection mode
  -s      only allow mouse selection mode
  -W      start interaction in window selection mode
  -x      do not play sounds
  -S      in window capture mode, capture the screen not the window
  file    where to save the screen capture

Obviously, this doesn't do video capture.

Snapz Pro is scriptable - up to a point. It has 2 commands: 'invoke' to
bring the capture palette up, and 'capture' to grab an image of the screen.

Grab doesn't appear to have any dictionary at all.

--
Barry



> From: Matthew <email@hidden>
> Date: Fri, 11 Feb 2005 00:32:03 -0500
> To: <email@hidden>
> Subject: Hotkeys to Snapz Pro or Grab
>
> Hello,
>
> I'd like to be able to send hotkey combinations like Cmd-Shift-3, or
> any other combination for that matter to Snapz Pro X to stop video
> recording or use a similar key combination to invoke screen capture,
> open Grab, etc.  I'm not so much interested in working around this
> (unless it's by programatically sending keystrokes) as I am actually
> using AppleScript to do it for me.
>
> Here's what I've tried, and I'm running Panther.
>
> tell application "System Events"
> keystroke "3" using {shift down, command down}
> end tell
>
>
> Ok, so that obviously didn't work, although intuitively I thought it
> would. I also tried a variation where I nested a "tell process "Snapz
> Pro X" inside the "tell application" but that didn't work either, and I
> really didn't expect it to.
>
> Is the problem that I'm not supposed to be sending this to "System
> Events" or that AppleScript just can't do this? I read in the Snapz Pro
> docs that they registered their hotkeys to be intercepted and processed
> down on the Carbon level, but I'm not sure if that's relevant?
>
> If you don't have Snapz Pro X, could someone comment on how to get
> something like Grab to invoke via using a hotkey combination
> Cmd-Shift-4 by applescript sending they keystrokes (or any other
> programatically way of doing it)?
>
> If this isn't possible, has anyone else had to work around it before?
> I've been looking in CarbonEvents.h a bit.
>
> Matthew
>
>
>
>  _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Applescript-users mailing list      (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Hotkeys to Snapz Pro or Grab
      • From: Matthew <email@hidden>
  • Prev by Date: Re: I don't want Quark Temporary Info!!!
  • Next by Date: Re: Getting Status of a not responding application
  • Previous by thread: Re: Hotkeys to Snapz Pro or Grab
  • Next by thread: Re: Hotkeys to Snapz Pro or Grab
  • Index(es):
    • Date
    • Thread