Re: [#!/fr] screencapture

Page principale
Supprimer ce message
Répondre à ce message
Auteur: KOENIG Yvan
Date:  
À: La liste francophone des scripts shell
Sujet: Re: [#!/fr] screencapture
Merci

J'apprends grâce à vous que le paramètre -l doit être accompagné d'un <windowID>
ce qui semble exclure toute autre forme de référence à la fenêtre à capturer.

J'avais lu quelque part qu'il est possible de doter une application d'une scriptabilité basique qui serait peut-être suffisante.
J'ai oublié les détails mais il me semble que ça impliquait de modifier une plist.
Ce sera inutilisable avec Mountain Lion car les applis vérifieront leur parfaite intégrité.


Yvan KOENIG (VALLAURIS, France) dimanche 15 avril 2012 19:56:44


Le 15 avr. 2012 à 19:27, alain content a écrit :

> Bonjour,
>
> Voici qq docs.
>
> Sinon, est-ce que rendre Preview scriptable est une option ?
>
> h:Desktop ac$ screencapture -h
> screencapture: illegal option -- h
> usage: screencapture [-icMPmwsWxSCUtoa] [files]
>  -c         force screen capture to go to the clipboard
>  -C         capture the cursor as well as the screen. only in
> non-interactive modes
>  -d         display errors to the user graphically
>  -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
>  -m         only capture the main monitor, undefined if -i is set
>  -M         screen capture output will go to a new Mail message
>  -o         in window capture mode, do not capture the shadow of the window
>  -P         screen capture output will open in Preview
>  -s         only allow mouse selection mode
>  -S         in window capture mode, capture the screen not the window
>  -t<format> image format to create, default is png (other options include
> pdf, jpg, tiff and other formats)
>  -T<seconds> Take the picture after a delay of <seconds>, default is 5
>  -w         only allow window selection mode
>  -W         start interaction in window selection mode
>  -x         do not play sounds
>  -a         do not include windows attached to selected windows
>  -l<windowid> capture this windowsid
>  files   where to save the screen capture, 1 file per screen

>
> *SCREENCAPTURE(1)          BSD General Commands Manual
> SCREENCAPTURE(1)*

>
> *NAME*
>     screencapture -- capture images from the screen and save them to a
> file or the clipboard

>
> *SYNOPSIS*
>     screencapture [-SWCTMPcimswxto] file

>
> *DESCRIPTION*
>     The screencapture utility is not very well documented to date.  A list
> of options follows.

>
>     -c      Force screen capture to go to the clipboard.

>
>     -C      Capture the cursor as well as the screen.  Only allowed in
> non-interactive modes.

>
>     -i      Capture screen interactively, by selection or window.  The
> control key will cause the screen shot to go to the clipboard.  The space
> key will toggle between mouse selection and window selection modes.  The
> escape key will cancel the interactive screen shot.

>
>     -m      Only capture the main monitor, undefined if -i is set.

>
>     -M      Open the taken picture in a new Mail message.

>
>     -o      In window capture mode, do not capture the shadow of the
> window.

>
>     -P      Open the taken picture in a Preview window.

>
>     -s      Only allow mouse selection mode.

>
>     -S      In window capture mode, capture the screen instead of the
> window.

>
>     -t      <format> Image format to create, default is png (other options
> include pdf, jpg, tiff and other formats).

>
>     -T      <seconds> Take the picture after a delay of <seconds>, default
> is 5.

>
>     -w      Only allow window selection mode.

>
>     -W      Start interaction in window selection mode.

>
>     -x      Do not play sounds.

>
>     -a      Do not capture attached windows.

>
>     files   where to save the screen capture, 1 file per screen

>
> *BUGS*
>     Better documentation is needed for this utility.

>
> *SECURITY CONSIDERATIONS*
>     To capture screen content while logged in via ssh, you must launch
> screencapture in the same mach bootstrap hierarchy as loginwindow:

>
>     PID=pid of loginwindow
>     sudo launchctl bsexec $PID screencapture [options]

>
> *HISTORY*
>     A screencapture utility first appeared in Mac OS X v10.2.

>
> Mac OS                           June 16, 2004                          Mac
> OS
> ----

>
> Le 15 avril 2012 17:01, KOENIG Yvan <koenig.yvan@???> a écrit :
>
>> Bonjour
>>
>> J'essaie de dépanner quelqu'un dans le forum macScripter mais je bute sur
>> un petit problème.
>>
>> Chaque fois que je déniche un man de la fonction screencapture sur le net,
>> il contient la formule qui tue : ce manuel est incomplet.
>>
>> Résultat je suis bloqué.
>>
>> Par tatonnements, j'ai compris que le paramètre -l active le mode «
>> capture de fenêtre »
>>
>> Quel types de références sont autorisés pour spécifier la fenêtre à
>> capturer ?
>>
>> Avec Safari, je peux employer :
>>
>> tell application "Safari" to set winID to id of window 1
>> do shell script "screencapture -c -x -o -l " & winID --
>>
>> mais une application non scriptable comme par exemple Aperçu ne peut me
>> renseigner sur la fenêtre en premier plan.
>>
>> Je peux utiliser :
>>
>> set theApp to "Preview"
>> activate application theApp
>> tell application "System Events" to tell application process "theApp"
>>       properties of window 1
>> end tell

>>
>> mais ça me retourne :
>>
>> {minimum value:missing value, orientation:missing value, position:{-66,
>> 768}, class:window, role description:"fenêtre standard", accessibility
>> description:missing value, focused:false, title:"2011 026.jpg", size:{747,
>> 1050}, value:missing value, help:missing value, enabled:missing value,
>> maximum value:missing value, role:"AXWindow", entire contents:{},
>> subrole:"AXStandardWindow", selected:missing value, name:"2011 026.jpg",
>> description:"fenêtre standard"}
>>
>> et je ne suis pas avancé parce que remplacer winID par le nom/titre de
>> fenêtre génère une erreur.
>>
>> Les paramètres position et size me permettraient de déterminer, en mode
>> capture d'écran, la zone écran à capturer mais là encore bernique, le
>> manuel ne donne aucune information.
>>
>> D'avance merci pour tout tuyau.
>>
>> Yvan KOENIG (VALLAURIS, France) dimanche 15 avril 2012 17:01:15
>>
>>
>>
>> _______________________________________________
>> archives :
>> http://listes.patpro.net/list/sshfr.fr.html
>> http://listes.patpro.net/mailman/listinfo/script_shell_fr
>>
> _______________________________________________
> archives :
> http://listes.patpro.net/list/sshfr.fr.html
> http://listes.patpro.net/mailman/listinfo/script_shell_fr

_______________________________________________
archives :
http://listes.patpro.net/list/sshfr.fr.html
http://listes.patpro.net/mailman/listinfo/script_shell_fr