iCal: Importiere abonnierten Kalender in Lokalen…

Code zum markieren einmal anklicken Code im Skript-Editor öffnen

tell application “iCal”

activate

##wähle eine Kalender aus und ermittle seine UID

## dies ist auch der Ordnername im ~/Library/Calendars in dem die plist mit

## der URL des Kalenders liegt

set callist to (name of every calendar whose writable is false)

set callist2 to (name of every calendar whose writable is true)

set callToExport to (choose from list callist default items (item 1 of callist) with prompt “Exportiere…:”)

set callToImport to (choose from list callist2 default items (item 1 of callist2) with prompt “Importiere in…:”)

if callToExport is not false and callToImport is not false then

set callUID to uid of calendar (callToExport as text)

##nun die URL des Kalenders auslesen

set myurl to (do shell script “defaults read ~/Library/Calendars/” & callUID & “.calendar/Info SubscriptionURL”)

if myurl starts with “webcal” then

set myurl to “http” & (characters 7 through -1 of myurl) as text

end if

##sollte ein kennwort für den Download notwendig sein:

## set myusername to “username”

## set mypassword to “geheim”

## set myurl to “http://” & myusername & “:” & mypassword & “@” & (characters 8 through -1 of myurl) as text

#####

do shell script “cd /tmp;curl ” & myurl & ” > ” & quoted form of (callToExport as text) & “.ics;open ” & quoted form of (callToExport as text) & “.ics”

delay 1

activate application “iCal”

tell application “System Events”

tell process “iCal”

click pop up button 1 of window “Ereignisse hinzufügen”

keystroke (callToImport as text)

delay 0.25

keystroke return

delay 0.25

keystroke return

end tell

end tell

end if

end tell

One thought on “iCal: Importiere abonnierten Kalender in Lokalen…

  1. […] iCal: Importiere abonnierten Kalender in Lokalen…Copyright © 2012 IT技术园地. All Rights Reserved. […]

Leave a Reply