Archives actuelles avec moteur de recherche
N'hésitez pas à vous inscrire à la liste : http://listes.patpro.net/mailman/listinfo/applescript_fr
Apple, AppleScript, AppleScript Studio, AppleTalk, AppleWorks, ColorSync, Finder, HyperCard, iBook, iLife, iMac, iWork, Keynote, Mac, Macintosh, Mac OS, Pages, Panther, PowerBook, Power Mac, Power Macintosh, QuickTime, Safari, Tiger, Xcode sont des marques déposées par Apple Computer, Inc., enregistrées aux Etats-Unis et dans les autres pays. Liste officielle
De : (Liste AppleScript francophone) <applescript_fr@xxxxxxx.net>
À : "(Liste AppleScript francophone)" <applescript_fr@xxxxxxx.net>
Date : mardi 26 février 2002 06:00
Objet : applescript_fr Digest #432
Liste AppleScript francophone Digest #432
1) Re: Changer l'icone d'un dossier
by "Christophe Delb@rt" <delbart.c@xxxxxxx.apple.com>
2) Re: Changer l'icone d'un dossier
by "Christophe Delb@rt" <delbart.c@xxxxxxx.apple.com>
3) Re: date et heure
by "Serge.Tegta" <Serge.Tegta@xxxxxxx.fr>
4) Re: OE 5 - Afficher barres d'outils automatiquement
by SeguS <wirinum@xxxxxxx.fr>
5) Re: OE 5 - Afficher barres d'outils automatiquement
by Georges Schell <gs@xxxxxxx.com>
6) Un truc bizarre avec GraphicConverter
by Dominique <listeasdomi@xxxxxxx.fr>
7) truc bizarre
by Stéphane Willard <swillard@xxxxxxx.com>
8) Re: truc bizarre
by Jean-Marie Hoornaert <jean.marie.hoornaert@xxxxxxx.be>
De : "Christophe Delb@rt" <delbart.c@xxxxxxx.apple.com> Date : Mon, 25 Feb 2002 07:07:26 +0100 Objet : [AS] Re: Changer l'icone d'un dossier Un tout grand merci Daniel... C'est super. Et comme dit Jean-Marie, avec l'explication théorique c'est encore mieux.... Il est 6h45.. je viens d'arriver au bureau et je vais tester cette partie de script de ce pas... En fait, Daniel, ici, en Belgique, nous avons équipé les 2800 écoles primaires de la partie francophone du pays avec +/- 10.000 iMacs. Il y a vait des configurations différentes (Mono, triplette, doucble-triplette et triple-triplette). Et nous avons "joué" avec les couleurs des iMacs pour faciliter le partage de fichiers. Jusqu'à présent, les enseignants ou les personnes ressources de l'école devaient effectuer manuellement les reconfigurations des iMacs après restauration. Mais pour la nouvelle mouture du CD, j'ai créé un script qui nous fera gagné bcp de temps. Si tu veux, je peux t'envoyer ce script pour que tu me donnes ton avis (il y a surement des corrections à apporter..mais jusqu'ici ca marche plutot bien)..et que tu voies un peu les manipulations. Il y aura aussi un deuxième script qui feront montés les dossiers partagés présents sur le réseau et créer des alias sur le disque. > Tiens une question : > pourquoi faire choisir une couleur pour un dossier qui s'appelle > déjà > "Documents Serveur rouge" ? > ] Parce que ce dossier sera créé en fonction des données rentrées parl'utilisateur et pour faciliter la "lecture" des dossiers par les enfants et les profs. Comme il y a souvent plusieurs dossiers "Documents Serveur" qui apparaitront sur le bureau, une couleur et dans ce cas maintenant une icone personnalisée sera plus parlant que le nom seul... Encore un tout grand merci pour ton aide au combien précieuse Christophe
De : "Christophe Delb@rt" <delbart.c@xxxxxxx.apple.com> Date : Mon, 25 Feb 2002 12:02:48 +0100 Objet : [AS] Re: Changer l'icone d'un dossier Super Daniel ;-) ca marche... en fait le problème du dossier vide venait du fait qu'à l'intérieur du dossier source se trouvaient des fichiers et pas des dossiers. J'ai donc employé comem tu le suggérais, la fonction "item" plutot que file ou folder. J'ai adapté tt cela ds mon script existant et le résultat est excellent. Encore merci Christophe
De : "Serge.Tegta" <Serge.Tegta@xxxxxxx.fr> Date : Mon, 25 Feb 2002 14:17:39 +0100 Objet : [AS] Re: date et heure Bonjour Voici le script dont je me sert pour dater des fichier... Vous devez le connaître, je l'ai trouvé quelque part sur le net... et un peu personnalisé... -- TIME et DATE on format_time_using(this_date_record, delimiter_string, format_list) set the time_index to the time of this_date_record set the hour_index to ((the time_index) / hours) div 1 set the minute_index to ¬ (((the time_index) / minutes) - (the hour_index * 60)) div 1 set the seconds_index to ¬ ((the time_index) - (the hour_index * 3600) - (the minute_index * 60)) div 1 set the formatted_time to "" -- count the number of items in the list set the item_count to the count of the format_list -- parse the format list repeat with i from 1 to the item_count set this_item to item i of the format_list if this_item is "H" then set the formatted_time to ¬ the formatted_time & the hour_index as string else if this_item is "HH" then if the hour_index is less than 10 then ¬ set hour_index to ¬ ("0" & (the hour_index as string)) set the formatted_time to ¬ the formatted_time & hour_index as string else if this_item is "M" then set the formatted_time to ¬ the formatted_time & the minute_index as string else if this_item is "MM" then if the minute_index is less than 10 then ¬ set minute_index to ¬ ("0" & (the minute_index as string)) set the formatted_time to ¬ the formatted_time & minute_index as string else if this_item is "S" then set the formatted_time to ¬ the formated_time & the seconds_index as string else if this_item is "SS" then if the seconds_index is less than 10 then ¬ set seconds_index to ¬ ("0" & (the seconds_index as string)) set the formatted_time to ¬ the formatted_time & seconds_index as string end if if i is not the item_count then -- add delimiter set the formatted_time to ¬ the formatted_time & delimiter_string as string end if end repeat return the formatted_time end format_time_using set the time_slug to my format_time_using(the current date, "/", {"HH", "MM"}) on format_date_using(this_date_record, delimiter_string, format_list) -- get the numeric day set numeric_day to the day of this_date_record -- get the month set month_name to the month of this_date_record -- convert month to number set the list_of_months to {January, February, March, April ¬ , May, June, July, August, September, October, November, December} repeat with i from 1 to 12 if item i of the list_of_months is the month_name then set the numeric_month to i exit repeat end if end repeat -- get the numeric year as text set numeric_year to the year of this_date_record as string set the formatted_date to "" -- count the number of items in the list set the item_count to the count of the format_list -- parse the format list repeat with i from 1 to the item_count set this_item to item i of the format_list if this_item is "D" then set the formatted_date to ¬ the formatted_date & numeric_day as string else if this_item is "DD" then if the numeric_day is less than 10 then ¬ set numeric_day to ¬ ("0" & (the numeric_day as string)) set the formatted_date to ¬ the formatted_date & numeric_day as string else if this_item is "M" then set the formatted_date to ¬ the formatted_date & numeric_month as string else if this_item is "MM" then if the numeric_month is less than 10 then ¬ set numeric_month to ¬ ("0" & (the numeric_month as string)) set the formatted_date to ¬ the formatted_date & numeric_month as string else if this_item is "YY" then set the formatted_date to ¬ the formatted_date & ¬ ((characters 3 thru 4 of numeric_year) as string) else if this_item is "YYYY" then set the formatted_date to ¬ the formatted_date & numeric_year end if if i is not the item_count then -- add delimiter set the formatted_date to ¬ the formatted_date & delimiter_string as string end if end repeat return the formatted_date end format_date_using set the date_slug to my format_date_using(the current date, "/", {"MM", "DD", "yy"}) Mais j'ai un petit probleme J'ai besoin de verifier si un fichier créer 20 minutes auparavant existe bien. Par exemple il est 18:24 je créer un fichier 01/02/15/02/18/24 (cad date_slug & time_slug) seulement si fichier 01/02/15/02/18/04 existe sinon je fais autre chose. Mais comment faire pour retrancher 20 minutes au format de date que j'utilise afin de comparer avec ce qui existe ? Autrement dit comment retrancher 20 minutes à time_slug ??? Suis-je comprehensible ? merci a+ g
De : SeguS <wirinum@xxxxxxx.fr> Date : Mon, 25 Feb 2002 16:56:29 +0100 Objet : [AS] Re: OE 5 - Afficher barres d'outils automatiquement ==> Message de "Luc Therrien" du 12/02/2002 23:57 : > Je veux donc construire un script qui, à chaque ouverture d'OE 5 assurera > l'affichage de la barre d'outils. Je suis novice avec AppleScript, alors je > me demandais si quelqu'un aurait un petit script pour moi. il me semble que même si tu desactive la barre d'outil (pomme-B), au lancement elle se reactive automatiquement, non ? -- Serge Ségu wirinum@xxxxxxx.fr
De : Georges Schell <gs@xxxxxxx.com> Date : Mon, 25 Feb 2002 17:43:02 +0100 Objet : [AS] Re: OE 5 - Afficher barres d'outils automatiquement SeguS <wirinum@xxxxxxx.fr> wrote : > il me semble que même si tu desactive la barre d'outil (pomme-B), au > lancement elle se reactive automatiquement, non ? Elle ne se réactive pas chez moi (OE 5.02) A+, Georges > ==> Message de "Luc Therrien" du 12/02/2002 23:57 : > >> Je veux donc construire un script qui, à chaque ouverture d'OE 5 assurera >> l'affichage de la barre d'outils. Je suis novice avec AppleScript, alors je >> me demandais si quelqu'un aurait un petit script pour moi.
De : Dominique <listeasdomi@xxxxxxx.fr> Date : Mon, 25 Feb 2002 20:26:21 +0100 Objet : [AS] Un truc bizarre avec GraphicConverter Un truc bizarre... Je veux créer une icône/aperçu pour une image avec GraphicConverter. Dans le dictionnaire je vois ceci : create icon : creates a custom icon for the file create icon -- file reference Bien. Le dictionnaire de GC me donne ensuite : file file [r/o] -- the disk file associated with the window, if any Bien. J'écris : create icon (file of window 1) ça rouspète ;-) Bien. file of window 1 as string ça rouspète ;-) Essayons en deux temps : set lefich to file of window 1 lefich as string ça à l'air d'aller ; terminons : create icon lefich Ça marche ! Finalement, j'ai réussi à faire obéir GC ;-) Mais, petite question théorique : pourquoi est-on obligé de procéder en deux temps ? -- (-8 domi
De : Stéphane Willard <swillard@xxxxxxx.com> Date : Mon, 25 Feb 2002 17:23:25 -0500 Objet : [AS] truc bizarre Alors la le mystere complet: voici un script que quelqu'un avait fait et qui tournait bien. Et du jour au lendemain ca plante! Et je n'y ai pas touché! Si vous avez une idée parceque moi, ce truc je n'ai pas compris la syntaxe to my(choose folder with prompt "Choisissez un dossier contenant des images à saisir...") Merci d'avance Stéphane Tell app "Filemaker Pro" set VCode to cell "Gcode_produit" end tell Tell app "Finder" set VFolder to my(choose folder with prompt "Choisissez un dossier contenant des images à saisir...") repeat with VFichier in VFolder if kind of VFichier is not "Folder" set VPath to (VFichier as string) tell app "Filemaker Pro" make new record at end show last record set cell "code_produit" to VCode set cell "chemin_document" to VPath set cell "image" to file (VPath) end end end end
De : Jean-Marie Hoornaert <jean.marie.hoornaert@xxxxxxx.be> Date : Tue, 26 Feb 2002 00:23:30 +0100 Objet : [AS] Re: truc bizarre Le lundi 25 février 2002 à 17:23, Stéphane Willard écrit : >Tell app "Filemaker Pro" >set VCode to cell "Gcode_produit" >end tell La rubrique "Gcode_produit" est une globale contenant probablement le type d'image à importer (exemple "GIFf"). Lorsque tu lance le script, y a-t-il au moins une fiche active dans la base FileMaker? Sinon, erreur "Objet introuvable". Note, ce code produit n'est ensuite pas utilisé pour tester le type de documents présents dans le dossier "VFolder". >Tell app "Finder" >set VFolder to my(choose folder with prompt "Choisissez un dossier contenant >des images à saisir...") >repeat with VFichier in VFolder >if kind of VFichier is not "Folder" plutot que de vérifier si l'élément est un fichier, vérifie s'il est du type prévu par la globale "Gcode_produit" --> if (file type of VFichier) is VCode then >set VPath to (VFichier as string) >tell app "Filemaker Pro" >make new record at end >show last record >set cell "code_produit" to VCode >set cell "chemin_document" to VPath >set cell "image" to file (VPath) >end Là, je conseille la syntaxe suivante, plus rapide : set nouveau to (create new record) set cell "code_produit" of nouveau to VCode set cell "chemin_document" of nouveau to VPath set cell "image" of nouveau to file (VPath) Et de n'afficher la dernière image qu'en fin d'importation : tell application "FileMaker Pro" activate go to last record end tell Le script complet devient donc quelque chose comme [SCRIPT] tell application "FileMaker Pro" to ¬ set VCode to cell "Gcode_produit" tell application "Finder" set VFolder to (choose folder with prompt ¬ "Choisissez un dossier contenant des images à saisir...") repeat with VFichier in VFolder if (file type of VFichier) is VCode then set VPath to (VFichier as string) tell application "FileMaker Pro" set nouveau to (create new record) set cell "code_produit" of nouveau to VCode set cell "chemin_document" of nouveau to VPath set cell "image" of nouveau to file (VPath) end tell end if end repeat end tell tell application "FileMaker Pro" activate go to last record end tell [/SCRIPT] J'ai tester avec Smile et FileMaker sur un dossier contenant 31 images gif et 2 dossiers. -- Cordialement. Jean-Marie -HOO;-) ____________________ Jean-Marie Hoornaert Courriel : jmh@xxxxxxx.be PPsP* : http://www.h2o.be Newsletter : jmh@xxxxxxx.be?subject=Infos_h2o * Page Personnelle sans Prétention * pour AppleScripter FileMaker