Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: pehache Newsgroups: fr.comp.sys.mac.programmation Subject: =?UTF-8?Q?Re=3a_Gestion_de_captures_d=27=c3=a9cran_par_AppleScript_?= =?UTF-8?B?W1dhczogVXRpbGl0YWlyZSBkZSBjYXB0dXJlIGQnw6ljcmFuID9d?= Date: Tue, 8 Feb 2022 15:34:17 +0100 Lines: 31 Message-ID: References: <62027b2f$0$28585$426a74cc@news.free.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: individual.net u0nJltUD8zfZJ22pnd7WbAV4Lx+JlGCWuFDYpTv2LhQtFWPf8O Cancel-Lock: sha1:SHDd7be7gyYh0vR/DPXmA8wHjak= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Content-Language: fr In-Reply-To: <62027b2f$0$28585$426a74cc@news.free.fr> Xref: csiph.com fr.comp.sys.mac.programmation:2170 Le 08/02/2022 à 15:16, "Benoît L." a écrit : > Ni vu ni connu, le 8 février 2022 à 12:31, pehache osa écrire : > >> Juste un petit truc : je n'ai pas trouvé comment faire la capture par >> une instruction AppleScript native, je lance la commande "screencapture" >> par un appel shell script. Ce n'est pas très important, c'est juste par >> curiosité de savoir si on peut faire autrement. >> > > tell application "System Events" to keystroke "3" using {command down, > shift down} OK. Mais j'ai comme j'ai besoin du nom de fichier produit je reste avec la commande shell "screencapture" > Sinon j’ai trouvé ça comme base : > > set theDate to do shell script "date +%Y_%m_%d_%H%M%S" > set theTempPath to POSIX path of (path to desktop) > set thePath to theTempPath & "screenCapture_" & theDate & ".png" > > do shell script "screencapture -R320,210,848,440 -tpng" & space & quoted > form of thePath C'est à peu ce que je fais dans mon premier post ;) -- "...sois ouvert aux idées des autres pour peu qu'elles aillent dans le même sens que les tiennes.", ST sur fr.bio.medecine ST passe le mur du çon :