Re: [AS] Scripter mail

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Yvan KOENIG via Applescript_fr
Date:  
À: Liste AppleScript francophone
CC: Yvan KOENIG
Sujet: Re: [AS] Scripter mail
Vous pouvez peut-être essayer avec:

#<script>
tell application "Mail"
    # récupère le message sélectionné
    set unMessage to item 1 of (get the selection)
    # récupère le contenu du message
    set theDatas to (get content of unMessage)
end tell


set p2d to path to desktop as text
set targetFile to p2d & "enTexte_etxeTne.txt"

# Écrit le contenu dans un fichier texte sur le bureau
my writeto(targetFile, theDatas, «class utf8», false)

# Demande à Excel d'ouvrir le fichier. Syntaxe à vérifier
# tell application "Excel" to open file targetFile

# =====
(*
Handler borrowed to Regulus6633 - http://macscripter.net/viewtopic.php?id=36861
*)
on writeto(targetFile, theData, dataType, apendData)
    -- targetFile is the path to the file you want to write
    -- theData is the data you want in the file.
    -- dataType is the data type of theData and it can be text, list, record etc.
    -- apendData is true to append theData to the end of the current contents of the file or false to overwrite it
    try
        set targetFile to targetFile as «class furl»
        set openFile to open for access targetFile with write permission
        if not apendData then set eof of openFile to 0
        write theData to openFile starting at eof as dataType
        close access openFile
        return true
    on error
        try
            close access file targetFile
        end try
        return false
    end try
end writeto


#=====
#/<script>

Mais je suppose que sur ce forum il y a encore des utilisateurs d'Excel susceptibles de fournir les instructions requises.

Sinon, je peux demander sur un autre forum.

Yvan KOENIG (VALLAURIS, France) lundi 21 octobre 2019 19:40:11


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