Re: [AS] inclure le nom du fichier dans le corps du fichier

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Serge Ségu
Date:  
À: La liste AppleScript Francophone
Sujet: Re: [AS] inclure le nom du fichier dans le corps du fichier

Le 2 juin 09 à 10:00, Roland Bena a écrit :

> Je ne trouve pas comment entrer le nom du fichier dans le texte.


Avec la commande WRITE. Regarde le dictionnaire AppleScript
Barre de menus de l'Editeur de Scripts : Fenetre > bibliotheque >
standardAdditions > File Read/Write

un exemple de routine ci-dessous

writeFile("nom du ficher", chemin d'acces du fichier, true)

-- Write data to a file; parameter: text, filePath, boolean [false:  
overwrite the file]
on writeFile(theText, thePath, appendData)
    try
        set thePath to thePath as string
        set idFile to open for access file thePath with write permission
        if appendData is false then set eof of the idFile to 0
        write theText to idFile starting at eof
        close access id_file
    on error
        close access file thePath
        return false
    end try
end writeFile


Serge
--
http://macscripting.blogspot.com









_______________________________________________
Applescript_fr mailing list
Applescript_fr@???
http://listes.patpro.net/mailman/listinfo/applescript_fr