WAN IP per Apple Mail senden

G

Grummel

Aktives Mitglied
Thread Starter
Dabei seit
20.04.2006
Beiträge
147
Reaktionspunkte
0
Hallo zusammen.

Ich fand eben folgenden interessanten Beitrag, zwar etwas alt, aber enorm hilfreich:
eigene IP-Adresse per AppleScript auslesen

Das Script klappt auch wunderbar.

Nun möchte ich aber noch die WAN-IP an Apple Mail übergeben und von dort aus die Mail (inkl. IP an eine vorher bestimmte Mail-Adresse) senden.

Die absolute Spitze wäre natürlich noch, wenn dies nur geschieht, wenn sich die WAN-IP geändert hat. Ein regelmäßigen Start würde ich dann noch einbauen.

Leider habe ich von Apple-Script keine Ahnung, bin somit auf Euch angewiesen...

Schon an dieser Stelle vielen Dank!

Schöne Grüße

P.S. Unter dem großen "G" fand ich leider keine funktionierenden Angaben, wie z.B. hier. Da sind die Links dead.
 
Probiers mal so:

Code:
[B]property [/B][COLOR=#4F8F00][FONT=Verdana]theIP[/FONT][/COLOR][FONT=Verdana] : ""[/FONT][FONT=Verdana]
[/FONT]
[FONT=Verdana][B]set[/B] [COLOR=#4f8f00]currentIP[/COLOR] [B]to[/B] [COLOR=#012fbe][B]do shell script[/B][/COLOR] "/usr/bin/curl http://checkip.dyndns.org/ | grep -o '[0-9]*\\.[0-9]*\\.[0-9]*\\.[0-9]*'"[/FONT]
[COLOR=#4F8F00][FONT=Verdana][COLOR=#000000][B]if[/B] [/COLOR]currentIP[COLOR=#000000] ≠ [/COLOR]theIP[COLOR=#000000] [B]then[/B][/COLOR][/FONT][/COLOR]
[COLOR=#4F8F00][FONT=Verdana][COLOR=#000000]    [B]set[/B] [/COLOR]theIP[COLOR=#000000] [B]to[/B] [/COLOR]currentIP[/FONT][/COLOR]
[FONT=Verdana]    [B]tell[/B] [COLOR=#0433ff][I]application[/I][/COLOR] "Mail"[/FONT]
[COLOR=#0433FF][FONT=Verdana][COLOR=#000000]        [B]set[/B] [/COLOR][COLOR=#4f8f00]theNewMessage[/COLOR][COLOR=#000000] [B]to[/B] [/COLOR][B]make [/B]new [I]outgoing message [/I]with properties[COLOR=#000000] {[/COLOR][COLOR=#812fdc]subject[/COLOR][COLOR=#000000]:"Betreff", [/COLOR][COLOR=#812fdc]content[/COLOR][COLOR=#000000]:[/COLOR][COLOR=#4f8f00]theIP[/COLOR][COLOR=#000000], [/COLOR][COLOR=#812fdc]visible[/COLOR][COLOR=#000000]:[/COLOR][COLOR=#5d3292]false[/COLOR][COLOR=#000000]}[/COLOR][/FONT][/COLOR]
[COLOR=#4F8F00][FONT=Verdana][COLOR=#000000]        [B]tell[/B] [/COLOR]theNewMessage[/FONT][/COLOR]
[COLOR=#0433FF][FONT=Verdana][COLOR=#000000]            [/COLOR][B]make [/B]new [I]to recipient [/I]at[COLOR=#000000] [B]end[/B] [B]of[/B] [/COLOR][I]to recipients [/I]with properties[COLOR=#000000] {[/COLOR][COLOR=#812fdc]address[/COLOR][COLOR=#000000]:"[/COLOR][/FONT][/COLOR]jonnyive[COLOR=#0433FF][FONT=Verdana][COLOR=#000000]@me.com"}[/COLOR][/FONT][/COLOR]
[COLOR=#0433FF][FONT=Verdana][COLOR=#000000]            [/COLOR][B]send[/B][/FONT][/COLOR]
[FONT=Verdana]        [B]end[/B] [B]tell[/B][/FONT]
[FONT=Verdana]    [B]end[/B] [B]tell[/B][/FONT]
[B]end [/B][B]if[/B]
 
Hallo Pill

Das ist exakt das, was ich suchte! Klappt Hammer!!

Vielen - vielen Dank für den Code und die schnelle Antwort!

Grüße
 
Zurück
Oben Unten