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

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mathias Koerber
    Replies:
    8
    Views:
    1,379
    Kevin McMurtrie
    Aug 15, 2009
  2. qquito
    Replies:
    5
    Views:
    451
    William Mitchell
    Aug 2, 2007
  3. MSH
    Replies:
    13
    Views:
    301
    Priam
    Jun 6, 2008
  4. James Thompson
    Replies:
    1
    Views:
    336
    Nigel Garvey
    Sep 25, 2003
  5. bluNOboxSPAMthief

    script to call a script when "location" changes

    bluNOboxSPAMthief, May 20, 2004, in forum: AppleScript
    Replies:
    0
    Views:
    271
    bluNOboxSPAMthief
    May 20, 2004
  6. John Rethorst

    Script (in script menu) to run scripts

    John Rethorst, Feb 7, 2006, in forum: AppleScript
    Replies:
    4
    Views:
    366
    John Rethorst
    Feb 10, 2006
  7. D.M. Procida
    Replies:
    2
    Views:
    328
    Simon Slavin
    Oct 20, 2004
  8. Graham Anderson
    Replies:
    1
    Views:
    1,859
    Cory Cooper
    Oct 10, 2015
Loading...