apples script error

Discussion in 'AppleScript' started by Daniele Versari, Apr 21, 2015.

  1. Daniele Versari

    Daniele Versari New Member

    Joined:
    Apr 21, 2015
    Messages:
    1
    Likes Received:
    0
    I used to use this script in automator to automatically import events from csv to ical. However, since yosemite was released it does not work anymore. It seems to give an error (in italian: "la connessione non è valida").
    Can sombody help me?

    set OldDelimiters to AppleScript'stext item delimiters

    set LF to ASCII character 10

    set theFile to "/Users/dversari/Desktop/Orario.csv"

    set theLines to readtheFile

    set AppleScript'stext item delimiters to {LF}

    set theLines to paragraphs of theLines

    set AppleScript'stext item delimiters to {","}

    repeat with ThisLine in theLines

    if (count of ThisLine) > 0 then --ignore blanks

    set StartDate to date (text item 1 of ThisLine & " " & text item 2 of ThisLine)

    set EndDate to date (text item 3 of ThisLine & " " & text item 4 of ThisLine)

    set CalName to word 1 of text item 5 of ThisLine

    tell application "Calendar"

    set CalList to title of every calendar

    if CalName is in CalList then

    repeat with CalNo from 1 to count of CalList

    if CalName is itemCalNo of CalList then exit repeat

    end repeat

    else

    set NewOne to makenewcalendarat end of calendarswith properties {title:CalName}

    set CalNo to 1 + (count of CalList)

    end if

    tell calendarCalNo

    set newItem to makeneweventat end of eventswith properties {start date:StartDate}

    set summary of newItem to text item 6 of ThisLine

    set location of newItem to text item 7 of ThisLine

    set end date of newItem to EndDate

    end tell --calendar

    end tell --iCal

    end if

    end repeat

    set AppleScript'stext item delimiters to OldDelimiters
     
    Daniele Versari, Apr 21, 2015
    #1
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.