realbasic-nug.fr
[Top] [All Lists]

Re: AppleScript et piece jointe

To: REALbasic NUG French <realbasic-nug.fr@lists.realsoftware.com>
Subject: Re: AppleScript et piece jointe
From: Benoit Widemann <benoit@widemann.net>
Date: Thu, 19 Jun 2008 12:40:42 +0200
Authentication-results: mx.google.com; spf=neutral (google.com: 74.124.194.228 is neither permitted nor denied by best guess record for domain of realbasic-nug.fr-bounces@lists.realsoftware.com) smtp.mail=realbasic-nug.fr-bounces@lists.realsoftware.com
Delivered-to: listarchive@realsoftware.com
In-reply-to: <40FDD120-923E-4D17-B84E-22B4E0B6544D@marine-label.com>
References: <mailman.9.1213815603.11536.realbasic-nug.fr@lists.realsoftware.com> <7C43FE28-8890-4090-8693-1B57138B888A@realworks.fr> <40FDD120-923E-4D17-B84E-22B4E0B6544D@marine-label.com>
Reply-to: REALbasic NUG French <realbasic-nug.fr@lists.realsoftware.com>
Sender: realbasic-nug.fr-bounces@lists.realsoftware.com

On 19 juin 08, at 10:23, frael wrote:

oui, justement, comment vérifier la conversion ???
j'ai bien ajouté une ligne pour voir :
  display dialog (">" & laPj as text) & "<"

et dans les 2 cas (appel par RB / selection à la main) j'ai le même résultat !!!
...sauf que par RB le mail se crée sans la PJ


choose file renvoie un alias. RB passe probablement un pathname. La première chose à vérifier, c'est que le pathname permet effectivement de créer un alias. Essaie par exemple le script suivant pour voir.

tell application "Finder"
        activate
        set theAlias1 to choose file
        set theMacOS9Path to theAlias1 as string
display dialog "class: " & class of theAlias1 & return & "path: " & theMacOS9Path
        set theAlias2 to (theMacOS9Path as alias)
        set thePOSIXPath to POSIX path of theAlias2
display dialog "class: " & class of theAlias2 & return & "path: " & thePOSIXPath
        set theAlias3 to (thePOSIXPath as alias) -- erreur
        display dialog "class: " & class of theAlias3 -- on n'ira pas jusque là
end tell

En résumé : si le path est à la Mac OS 9, tu peux le typecaster en alias, mais pas s'il est au format unix. La notion même d'alias est encore fortement attachée à Carbon...

B.

// http://www.widemann.net //








<Prev in Thread] Current Thread [Next in Thread>