Deutsch English Français Italiano |
<su5ruf$sj7$1@shakotay.alphanet.ch> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!weretis.net!feeder8.news.weretis.net!news.imp.ch!news.alphanet.ch!alphanet.ch!.POSTED.lfbn-ren-1-614-45.w81-53.abo.wanadoo.fr!not-for-mail From: =?UTF-8?B?IkJlbm/DrnQgTC4i?= <benoit@com.invalid> Newsgroups: fr.comp.sys.mac.programmation Subject: Re: =?UTF-8?B?Q29tbWVudCBwYXNzZXIgU2lnbkF1UGlmIMOgIGxhIHZpdGU=?= =?UTF-8?B?c3NlIHN1cMOpcmlldXJlwqA/?= Date: Fri, 11 Feb 2022 14:30:39 -0000 (UTC) Organization: C'est celui qui dit qui est Sender: bobduvallois@lfbn-ren-1-614-45.w81-53.abo.wanadoo.fr Archive: no Message-ID: <su5ruf$sj7$1@shakotay.alphanet.ch> References: <stj4f8$iuq$1@shakotay.alphanet.ch> <1pn64p7.1256jl67qvsrlN%gd2512@free.fr> <su41vm$5vh$1@shakotay.alphanet.ch> <1pn6oob.1jnbeqy11ey2yoN%josephb@nowhere.invalid> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Fri, 11 Feb 2022 14:30:39 -0000 (UTC) Injection-Info: shakotay.alphanet.ch; posting-host="lfbn-ren-1-614-45.w81-53.abo.wanadoo.fr:81.53.19.45"; logging-data="29287"; mail-complaints-to="usenet@alphanet.ch" User-Agent: MacCafe/2.06 (macOS 10.15.7 (19H1615) - MacBookPro14,2) Cancel-Lock: sha1:2jmDIJCsBTWJ8PhkCqsWJk4m0V4= sha256:2tF8/mp677OvLAGpZN0tHgnPiR62GsIGllmIXbKHorQ= In-Reply-To: <1pn6oob.1jnbeqy11ey2yoN%josephb@nowhere.invalid> X-No-Archive: yes Bytes: 5487 Lines: 88 Ni vu ni connu, le 10 février 2022 à 23:43, Joseph-B osa écrire : > "Benoît L." <benoit@com.invalid> wrote: > >> Cela étant, faire une version sans interface, juste un raccourci-clavier >> qui lance le script pourquoi pas. > > je te propose une autre solution à interface minimaliste de sélection au hasard d'une GMP. > Ce qui te chagrinait c'était les coupures de lignes dans le display dialog ? Là, c'est réglé. > > Dans le script que tu as posté l'autre jour, tu vas changer tout le bloc [repeat… end repeat] existant par celui que je te mets en dessous et tu essaies. > Regarde ce qui est dans le presse-papier. > Ce n'est pas très conventionnel mais ça peut marcher ? (tu fixeras la largeur de la boite à ta convenance) > Un Dble-Click dans la boite et ça te présente un autre GMP. Ça je ne connaissais pas. Cela étant un reproche : il faut deviner qu’on doit cliquer sur la signature pour pouvoir la changer (le bouton est grisé par défaut). À ce propos, je me demande si ce ne serait pas bien de pouvoir modifier la signature. > Si ça te convient, après tu verras à étendre avec un dialogue modal à 3 boutons ce que tu veux faire avec ce qui est dans le presse-papier. > > > ######################## > > repeat > set SignatureString to some item of theSignatureList as text > log SignatureString > set AppleScript's text item delimiters to "¬" > set tempSig to every text item of SignatureString > log tempSig > set AppleScript's text item delimiters to linefeed > set finalSig to every text item of tempSig as text > set the clipboard to finalSig > set widthForced to {"*******************************************************************************************************"} > set ShowList to widthForced & tempSig as list > set textChoosen to choose from list ShowList with title "Signature GMP" with prompt "La citation affichée est copiée dans le Presse-Papier" OK button name "Choisir Autre GMP" cancel button name "Accepter" > if textChoosen = false then exit repeat > end repeat > > ######################## Merci, > N'y a pas de quoi Voici où j’en étais hier après-midi (lien vers l’app dans ma réponse à G.D. : ######################## repeat set accViewWidth to 650 set {theButtons, minWidth} to create buttons {"Quitter", "Nouveau tirage", "Copier"} default button "Copier" cancel button "Quitter" if minWidth > accViewWidth then set accViewWidth to minWidth -- make sure buttons fit set {theField, theTop} to create field finalSig bottom 0 field width accViewWidth extra height 60 with accepts linebreak and tab set {boldLabel, theTop} to create label "Au hasard :" bottom theTop + 20 max width accViewWidth control size regular size set {buttonName, controlsResults} to display enhanced window "SignAuPif" acc view width accViewWidth acc view height theTop acc view controls {theField, boldLabel} buttons theButtons active field theField initial position {0, 0} with align cancel button if buttonName is "Nouveau tirage" then set SignatureString to some item of theSignatureList as text set AppleScript's text item delimiters to "¬" set tempSig to every text item of SignatureString set AppleScript's text item delimiters to return set finalSig to every text item of tempSig as text end if if buttonName is "Copier" then set the clipboard to finalSig end repeat ######################## Pleins de choses à retirer, je suis sûr, mais « if it works, dont fix it ». Reste à savoir ajouter une case à cocher pour l’ajout ou non du « --_ » (j’essaye tout seul pour le moment). J’avance à petits pas car c’est dur de se remettre à coder, mais ça fait du bien. La photo et le crochetage de serrures sont plus faciles ;) -- Je pensais qu'avec toutes les pluies du mois de septembre, le covid aurait été lavé. -+- M.S. dans « L’infirmière dans “Persil contre Pfizer” » -+-