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

Anmeldedatum: 07.03.2003 Beiträge: 7
|
Verfasst am: 07.03.2003 - 00:30 Titel: filemaker + appleScript + Entourage |
|
|
Hi Zusammen,
Ich versuche aus Filemaker Daten(Emailadressen) in meinen Outlook zu schauffeln.
Leider bin ich newbie was AppleScript betrifft - vielleicht kann mir ja jemand helfen.
Das Script was ich jetzt habe schaut wie folgt aus:
--------------
tell application "FileMaker Pro"
go to first record
set strBcc to ""
set strAUSWAHL to last cell--Somit bekomme ich die Anzahl der ausgewählten records
set i to 1
repeat until (i = strAUSWAHL)
copy cell "Email" of current record to strBcc--<copy in array oder Liste??
set i to i + 1
if i = strAUSWAHL + 1 then exit repeat
go to record i
end repeat
set strMAILTO to {"dsdsdsd" & "<" & "info@sdsd.de" & ">"}
end tell
tell application "Microsoft Entourage"
activate
set theMSG to make new draft window with properties {to recipients:strMAILTO, BCC recipients:strBcc, subject:strAUSWAHL, content:"kjhjkjkjkjkg"}
end tell
-------------------------
Das Script funktioniert so weit, jedoch schreibt er in der neuen Nachricht bloß die letzte Emailadresse des Eintrages als BCC.
Wie kann ich meine Variablen in einen Art Array oder Liste ablegen
und dann mit einer Variable ansprechen.
Müßte dann so ausschauen
myvar="asa@as.de,asas@sasa.de,sdsd@sdsd.de, ......
Danke im voraus!
Marcus
--------------- |
|
Nach oben |
|
 |
Snow Administrator


Anmeldedatum: 21.11.2000 Beiträge: 1946 Wohnort: Deiningen
|
Verfasst am: 07.03.2003 - 23:56 Titel: |
|
|
Hallo Marcus,
du hast bereits die Stelle, die den Fehler beinhaltet markiert:
Code: |
set i to 1
repeat until (i = strAUSWAHL)
copy cell "Email" of current record to strBcc--<copy in array oder Liste??
set i to i + 1
if i = strAUSWAHL + 1 then exit repeat
go to record i
end repeat |
Indem du bei jeder Wiederholung einen Wert in die Variable strBcc kopierst, wird dieser ja nicht zusätzlich hinzu gefügt, sondern erstetzt den bisherigen Wert der Variablen. Du musst also mit einer Liste arbeiten.
set i to 1
set BccList to {} -- Liste erstellen
repeat until (i = strAUSWAHL)
-- das folgende Statement fügt bei jeder Wiederholung
-- einen neuen Listeneintrag hinzu
set the end of BccList to cell "Email" of current record
set i to i + 1
if i = strAUSWAHL + 1 then exit repeat
go to record i
end repeat
Gruß _________________ Peter
-
Fischer-Bayern.de|Shadetreemicro.com |
|
Nach oben |
|
 |
funky_nassau •->

Anmeldedatum: 07.03.2003 Beiträge: 7
|
Verfasst am: 10.03.2003 - 16:22 Titel: |
|
|
Hi Snow,
danke für Deine schnelle Antwort.
Leider fügt das Script bei Entourage bei mir nichts ein - vermutlich weil ich die Liste als Variable falsch anspreche?!
------------
tell application "FileMaker Pro"
go to first record
set strBcc to ""
set strAUSWAHL to last cell
set i to 1
set BccList to {}
repeat until (i = strAUSWAHL)
set the end of BccList to cell "Email" of current record
--set AppleScript's text item delimiters to {","}<-brauch ich das? oder werden Kommas automatisch eingefügt?
set i to i + 1
if i = strAUSWAHL + 1 then exit repeat
go to record i
end repeat
set strMAILTO to {"sdsdsd" & "<" & "info@dsdsd.de" & ">"}
end tell
tell application "Microsoft Entourage"
activate
set theMSG to make new draft window with properties {to recipients:strMAILTO, BCC recipients:BccList, subject:"bla bla", content:"kjhjkjkjkjkg"}
end tell
--------------
Danke im voraus!
Marcus
------------------ |
|
Nach oben |
|
 |
Snow Administrator


Anmeldedatum: 21.11.2000 Beiträge: 1946 Wohnort: Deiningen
|
Verfasst am: 10.03.2003 - 19:53 Titel: |
|
|
Hallo Marcus,
ich habe mir die Sache nochmal angesehen. Das Problem ist anscheinend, dass es sich bei BCC recipients nicht um eine Liste handeln darf, sondern ein Text erwartet wird.
Hier eine Version des Scripts, die zu funktionieren scheint. Genauere Tests überlasse ich dir.
tell application "FileMaker Pro"
go to first record
set strBcc to ""
set strAUSWAHL to count records
set i to 1
set BccList to ""
repeat until (i > strAUSWAHL)
if i is not strAUSWAHL then
set BccList to BccList & cell "Email" of current record & ", "
else
set BccList to BccList & cell "Email" of current record
end if
set i to i + 1
if i > strAUSWAHL then exit repeat
go to record i
end repeat
set strMAILTO to { "sdsdsd" & "<" & "info@dsdsd.de" & ">" }
end tell
tell application "Microsoft Entourage"
activate
set theMSG to make new draft window with properties { to recipients:strMAILTO, subject:"bla bla", content:"kjhjkjkjkjkg" }
set BCC recipients of window 1 to BccList
end tell
Gruß _________________ Peter
-
Fischer-Bayern.de|Shadetreemicro.com |
|
Nach oben |
|
 |
funky_nassau •->

Anmeldedatum: 07.03.2003 Beiträge: 7
|
Verfasst am: 10.03.2003 - 22:16 Titel: |
|
|
Hi Snow,
besten Dank für Deine Hilfe - exzellent gemeistert!!
Für alle die so ein Skript mal benötigen hab ich`s nochmal zusammengefaßt, da es bei mir nicht sofort gefunzt hat:
-----------------
tell application "FileMaker Pro"
go to first record
set strAUSWAHL to last cell--<-Gibt die ausgewählten Records in FM wieder
set i to 1
set Bcc to ""
repeat until (i > strAUSWAHL)--<-stept durch alle ausgewählten RECORDS in FM und schreibt die Zelle "Email" jedes Records in die Variable Bcc und hängt ein Komma an
if i is not strAUSWAHL then
set Bcc to Bcc & cell "Email" of current record & ", "
else
set Bcc to Bcc & cell "Email" of current record
end if
set i to i + 1
if i > strAUSWAHL then exit repeat
go to record i
end repeat
set strMAILTO to {"sdsdsd" & "<" & "info@dsdsd.de" & ">"}
end tell
tell application "Microsoft Entourage"
activate
set theMSG to make new draft window with properties {to recipients:strMAILTO, BCC recipients:Bcc, subject:"bla bla", content:"kjhjkjkjkjkg"}
end tell
-------------------------------------------------------- |
|
Nach oben |
|
 |
Snow Administrator


Anmeldedatum: 21.11.2000 Beiträge: 1946 Wohnort: Deiningen
|
Verfasst am: 10.03.2003 - 22:24 Titel: |
|
|
Zitat: | set strAUSWAHL to last cell--<-Gibt die ausgewählten Records in FM wieder |
Das hatte bei mir zu einem Fehler geführt. "last cell" sagt ja eigentlich nichts über die Anzahl der Datensätze aus. In der Datenbank, die ich zum Test benutzt hatte, war die letzte, definierte Zelle "Wohnort". Die Variable strAUSWAHL hat dann also einen Textwert mit dem Namen des Wohnorts enthalten.
An der Stelle:
Zitat: | repeat until (i > strAUSWAHL) |
bräuchte man aber eine Zahl - die konnte AppleScript aus dem Wohnort aber nicht generieren.
Deshalb hatte ich "count records" benutzt.
Den Cell-Namen "Von" (so hieß das Email-Feld in meiner DB) habe ich in meinem obigen Posting bereits wieder auf "Email" korrigiert.
Gruß _________________ Peter
-
Fischer-Bayern.de|Shadetreemicro.com |
|
Nach oben |
|
 |
funky_nassau •->

Anmeldedatum: 07.03.2003 Beiträge: 7
|
Verfasst am: 11.03.2003 - 03:01 Titel: |
|
|
!!!!!!!!!!!!!!!!!!!!!!!!!!PERFEKT!!!!!!!!!!!!!!!!!!!!!!!!!! |
|
Nach oben |
|
 |
|