| Vorheriges Thema anzeigen :: Nächstes Thema anzeigen |
| Autor |
Nachricht |
dschiemann •->

Anmeldedatum: 12.07.2010 Beiträge: 5
|
Verfasst am: 14.07.2010 - 10:31 Titel: wie kann man das Script 'tunen' - es läuft viel zu langsam |
|
|
das unten aufgeführte Script funktioniert eigentlich ganz gut - nur dauert es 5-10 Sek. bis die Mail in FileMaker importiert ist.
Kann mann das irgendwie schneller machen - ich weiß, mein Script ist wahrscheinlich sehr grob gestrickt.
Gruß aus Berlin und hier das Script:
| Code: |
set fileMakerFile to ((path to desktop as text) & "test.fp5")
tell application "Mail"
set selectedMessages to selection
if (count of selectedMessages) is equal to 0 then
display alert "keine Mail ausgewählt" message "Bitte zuerst eine Mail auswählen." buttons {"Cancel"} default button 1
error number -128
else
set theMessage to item 1 of selectedMessages
set theSource to source of theMessage
set theSubject to subject of theMessage
set theContent to source of theMessage
set theText to content of theMessage
set theSender to sender of theMessage
set theDate to date sent of theMessage
set theRecipient to (first recipient of theMessage) --numerischer Index, erster Empfänger
set theRecipientaddress to the address of theRecipient
set theRecipientname to the name of theRecipient
end if
end tell
set theDate to short date string of theDate
tell application "FileMaker Pro"
open (fileMakerFile as alias)
set newRecord to create new record
go to newRecord
set cell 1 of newRecord to theSource
set cell 2 of newRecord to theSubject
set cell 3 of newRecord to theSender
set cell 4 of newRecord to theDate
set cell 5 of newRecord to theRecipientaddress
set cell 6 of newRecord to theRecipientname
set cell 7 of newRecord to theText
end tell
|
|
|
| Nach oben |
|
 |
Manfred •-->

Anmeldedatum: 17.01.2005 Beiträge: 45 Wohnort: Graz - Austria
|
Verfasst am: 21.07.2010 - 13:38 Titel: |
|
|
Wenn's über viele Emails wirklich langsam ist ... dann ist dies der Grund:
| Code: | tell application "FileMaker Pro"
open (fileMakerFile as alias)
set newRecord to create new record
go to newRecord |
Du öffnest für jede Mail die Datenbank (und da muß der FileMaker etwas nachdenken, ob die Datenbank nicht schon offen ist und so ...
Den Befehl "go to newRecord" kannst ruhig weglassen. - Es funktioniert trotzdem.
| Code: | set fileMakerFile to ((path to desktop as text) & "Mailto.fp5")
tell application "FileMaker Pro"
open (fileMakerFile as alias)
end tell
tell application "Mail"
set selectedMessages to selection
if (count of selectedMessages) is equal to 0 then
display alert "keine Mail ausgewählt" message "Bitte zuerst eine Mail auswählen." buttons {"Cancel"} default button 1
error number -128
else
repeat with x in selectedMessages
set theMessage to the content of x
set theSource to source of x
set theSubject to subject of x
set theSender to sender of x
set theDate to date sent of x
set theDate to short date string of theDate
set theRecipientaddress to the address of (first recipient of x)
set theRecipientname to the name of (first recipient of x)
toFMP(theSource, theSubject, theSender, theDate, theRecipientaddress, theRecipientname, theMessage) of me
end repeat
end if
end tell
on toFMP(theSource, theSubject, theSender, theDate, theRecipientaddress, theRecipientname, theMessage)
tell application "FileMaker Pro"
set newRecord to create new record
set cell "Feld1" of newRecord to theSource
set cell "Feld2" of newRecord to theSubject
set cell "Feld3" of newRecord to theSender
set cell "Feld4" of newRecord to theDate
set cell "Feld5" of newRecord to theRecipientaddress
set cell "Feld6" of newRecord to theRecipientname
set cell "Feld7" of newRecord to theMessage
end tell
end toFMP |
Empfehlenswert: FileMaker-Feldnamen immer mit Namen und eben mit Ausführungszeichen ansprechen. _________________ Manfred M. |
|
| Nach oben |
|
 |
|
|
Du kannst keine Beiträge in dieses Forum schreiben. Du kannst auf Beiträge in diesem Forum nicht antworten. Du kannst deine Beiträge in diesem Forum nicht bearbeiten. Du kannst deine Beiträge in diesem Forum nicht löschen. Du kannst an Umfragen in diesem Forum nicht mitmachen.
|
Powered by phpBB © 2001, 2002 phpBB Group Deutsche Übersetzung von phpBB.de
|
|
|