Create new event in iCal that triggers an applescript

Dear applescripters
I am trying to write a script that creates an event in applescript that launches an applescript.
This is the code:
tell application "iCal"
tell calendar "Verstuur"
set theCurrentDate to current date
set time of theCurrentDate to (time of theCurrentDate) + 60
set verstuur to make new event at end with properties {start date:theCurrentDate, end date:theCurrentDate + 1 * minutes}
tell verstuur
make new open file alarm at end with properties {trigger interval:0, filepath:POSIX path of "file://localhost/Users/jschaafsma/Desktop/Verstuurfilmpje"}
end tell
end tell
end tell
when iCal tries to trigger the script iCal generates an error that the file Verstuurfilmpje is not found.
Any ideas what i am doing wrong?
Thanks
Jschaafsma

Well, for one, your file path isn't valid.
… filepath:POSIX path of "file://localhost/Users/jschaafsma/Desktop/Verstuurfilmpje"}
First off, POSIX path of takes a Mac-style (i.e. colon-delimited) path or alias and converts it to an POSIX path, so either you need to drop the 'POSIX path of' code, or pass in a Mac-style path.
Secondly, even if you were to use 'POSIX path of', your path specification is invalid anyway - you haven't passed in a POSIX path you've passed in a file URL, which is different. A POSIX path of that file would look like:
filepath: "/Users/jschaafsma/Desktop/Verstuurfilmpje"
So rewrite this line and you should be set.

Similar Messages

  • Creating new event in iCal from BBEdit data window.  Calendar number fails.

    When I try to create a new event in iCal I am getting the error "The variable theCalendarNumber is not defined." even though theCalendarNumber is supposed to be set in the preceding line. Does this have anything to do with embedding the tell application "iCal" within the tell application "BBEdit 6.5" loop?
    Before this error I was getting a NSContainerSpecifierError error. I think that was because I was trying to specify the calendar as a string instead of a number as required by Panther OS.
    BBEdit data window follows.........
    3/8/2009 Fun Fly CD ?
    4/5/2009 Fun Fly CD ?
    14/8/2009 Combat
    4/25/2009 Club Cleanup Workday
    5/2/2009 Electric Extravaganza
    5/17/2009 Fun Fly CD ?
    6/7/2009 Fun Fly CD ?
    7/12/2009 Fun Fly CD ?
    7/19/2009 Combat
    8/9/2009 Fun Fly CD ?
    8/14/2009 Combat
    8/22/2009 War Bird
    8/29/2009 Club Cleanup Workday
    9/5/2009 & 9/6/2009 IMAC
    9/13/2009 Fun Fly CD ?
    10/4/2009 Fun Fly CD ?
    11/9/2009 Fun Fly CD ?
    11/14/2009 Combat
    12/13/2009 Combat
    Applescript follows.......
    set theCals to {}
    set iCalendars to {}
    set theDate to current date
    set myDate to date string of theDate
    tell application "iCal"
    set theCals to calendars whose writable is true
    repeat with i from 1 to count of theCals
    copy title of item i of theCals to end of iCalendars
    end repeat
    end tell
    set theChoice to (choose from list iCalendars with prompt "Choose the Calendar to use" OK button name "Choose" without multiple selections allowed and empty selection allowed)
    tell application "BBEdit 6.5"
    repeat with i from 1 to count of lines in text window 1
    set the_line to contents of line of text window 1
    set old_delims to AppleScript's text item delimiters
    set AppleScript's text item delimiters to tab
    set the_Date to text item 1 of the_line
    set the_Event to text item 2 of the_line
    tell application "iCal"
    set theCalendarNumber to (first calendar whose title is theChoice)
    set theEvent to make new event at end of events of theCalendarNumber with properties {start date:the_Date, summary:"", description:the_Event}
    --if alarmTime is not 0 then
    --tell MyEvent
    --make new display alarm at end of display alarms with properties {trigger interval:alarmTime}
    --end tell
    --end if
    --show theEvent
    save
    end tell
    set AppleScript's text item delimiters to old_delims
    end repeat
    end tell
    tell application "iCal"
    reload calendars
    end tell

    You have a couple of issues here.
    First, the line:
    set theCalendarNumber to (first calendar whose title is theChoice)
    However, theChoice is defined at:
    set theChoice to (choose from list iCalendars with prompt "Choose the Calendar to use" OK button name "Choose" without multiple selections allowed and empty selection allowed)
    Since you're allowing multiple selections, theChoice will be a list.
    You can't get 'first calendar whose title is' a list. You will need to either permit single selections only, or extract the calendar name from the selected items (maybe iterating through them if you want to add the event to multiple calendars).
    Once you address that, the line:
    set theEvent to make new event at end of events of theCalendarNumber...
    also won't work because theCalendarNumber will be the name of a calendar, so this command tries to set the event to the end of events of a string. Instead you need to ask for the named calendar, like:
    set theEvent to make new event at end of events of calendar theCalendarNumber
    Then you should be set.

  • Unable to create new events in iCal

    I updated my iPhone 4 to iOS7, and now when I try to create a new event in iCal, nothing happens. I am able to tap the "+" and enter the event information, but when I tap "Done", no new event appears in the calendar.
    If I, instead, create the event in the Calendar on my PC, the phone syncs with Outlook, and the event appears on the phone's iCal app.
    Why am I suddenly unable to create new events on my phone in iOS7, and how can I fix this issue?

    Thanks! I've noticed the phone has been a bit "clunky" since the update too. Did you experience the same thing & did the hard restart help?

  • Cannot create new events in iCal - they dissappeaar after quitting

    Hello there,
    I've used iCal for many years with no problem.
    Recently I noticed that events were dissappearing.
    I can add events and use iCal as normal as long as I don't quit the program or restart my computer. I can put the computer to sleep and all my new events are fine, but as soon as I restart or quit and reopen ical all the new events have dissappeared. Bizarrely my old events remain intact and events in the future that I added before the problemn started are also still there.
    I have tried backing up the database before quitting, then reverting to the backup database, but even when i do this there are no new events visable.
    Can anyone offer any help. I feel like i need to reinstall iCal or something.
    Thanks.
    Damien

    Hmm....I was able to fix my issues. I'll share it here in the event it can help you.
    While iCal was closed I simply moved to trash the folder "/Users/<my username>/Library/Application Support/iCAl/" I then re-opened iCal and I could then create new or import old ".ics" files, close iCal and re-open with all information being retained. Sweet!

  • HT2513 Cannot Create New Events in iCal

    Hello:
    I recently deleted a large number of appointments from my iCal using my MacBook. Now, iCal on the MacBook will not allow me to see new events I want to create, but it will push the new events to my other devices using iCloud. What's going on?

    Hmm....I was able to fix my issues. I'll share it here in the event it can help you.
    While iCal was closed I simply moved to trash the folder "/Users/<my username>/Library/Application Support/iCAl/" I then re-opened iCal and I could then create new or import old ".ics" files, close iCal and re-open with all information being retained. Sweet!

  • I cant create new events in iCal on my Mac or display them

    Since a few days ago after upgrading to Lion when I want to create a new event it
    dosent show up in my calender. All the old events is shown and when I create an
    event for example on my iPhone and sync with iCal on my Mac I can see the
    new event.
    I click in the calender to make a new event, nothing shows up, but when syncing
    with my iPhone I can see the new event without any text because I didnt see the
    small eventbar to type in or make the right time for the event. Can anybody help
    me with this issue?
    Regards,
    Collins from Sweden!

    Called Apple fast track support and problem is resolved. User error, for some reason I had selected the wrong calendar - after selecting the proper calendar on the left sidebar I could create events. Apparently at some time I created a 'todo' mailbox. It had nothing in it and I ended up deleting it so it doesn't get selected again in error.
    Took 15 minutes to connect with an ICAL specialist. Once connected received excellent support.

  • Can,t create new events in ical on Mac book Pro.

    This morning when I try to add a new event a pop up appears "This calendar was created by Mail. You can’t add events to a Mail calendar. Mail calendars only contain to do items created in Mail." Ical worked fine yesterday. I have a mobile me acc and can edit the online calendar but not the one on my laptop.
    Thanks

    Called Apple fast track support and problem is resolved. User error, for some reason I had selected the wrong calendar - after selecting the proper calendar on the left sidebar I could create events. Apparently at some time I created a 'todo' mailbox. It had nothing in it and I ended up deleting it so it doesn't get selected again in error.
    Took 15 minutes to connect with an ICAL specialist. Once connected received excellent support.

  • When I try entering a new event in iCal on my MacBook Air, I get an error message popping up on my screen that says: The request for account "iCloud" failed.  The server responded with "502" to operation CalDAVSetPropertyQueueableOperation. Help!!??

    When I try entering a new event in iCal on my MacBook Air, I get an error message popping up on my screen that says:
    The server responded with “502”
    The request for account “iCloud” failed. 
    The server responded with “502” to operation CalDAVSetPropertyQueueableOperation.
    The request for account “iCloud” failed.
    I am then given the option of staying Online or going Offline.
    Can anyone help me?
    thanks

    Hello b.krushel,
    Thank you for using Apple Support Communities
    Any number of things could cause this issue, so I would recommend this article named iCloud: Troubleshooting iCloud Calendar found here http://support.apple.com/kb/TS3999.
    These sections in particular:
    General Troubleshooting
    Make sure there are no current issues listed on the System Status that affect iCloud Calendar. The System Status is located on the iCloud Support webpage.
    Make sure you have fully enabled iCloud Calendar for the client you are using (for more setup and troubleshooting information on iOS, OS X, Windows and iCloud.com, see the additional details below).
    Check to see if the issue you are seeing is covered in iCloud Help. To search iCloud Help, visit help.apple.com/icloud.
    Check your settings and preferences as something may not be set up correctly. For example, having incorrect date and time settings can cause issues which are easily resolved by entering the appropriate settings.
    Troubleshooting Calendar on OS X Mountain Lion (iCal on OS X Lion)Note: For instructions on setting up iCloud Calendar with Calendar or iCal on your Mac, see iCloud Setup.If you are having trouble with Calendar or iCal on a Mac and you are using iCloud Calendar, try each of these steps, testing after each to see if the issue is resolved:
    Make sure you are using OS X Lion v10.7.2 or later. Click here for help verifying the version of OS X you are using.
    Make sure your computer is online. Attempt to view www.apple.com and iCloud.com. If you can't connect to the Internet, your iCloud calendars and events will not update in iCal. Click here for more information about troubleshooting your Internet connection.
    Verify that your iCloud member name is entered into the iCloud Preference pane in System Preferences. See iCloud Setup for more information about setting up iCloud on a Mac.
    Make sure you enter and update calendar information in the iCloud section of Calendar or iCal. Only calendars and events in the iCloud section of the Calendar or iCal Calendar list will be pushed to iCloud. Both Calendar and iCal for the Mac support the display of and interaction with multiple accounts and datastores, for example, iCloud, On My Mac, Exchange, Google, and so on. This makes it easy to create or modify events or calendars in a section of  Calendar or iCal that may not be updating iCloud. Learn more about moving local calendars to iCloud.
    In some cases, you may find that you have data duplicated in both the local On My Mac and the iCloud sections of Calendar or iCal. Learn more about resolving this issue.
    You can make the iCloud calendar your default calendar for all new events. In Calendar on OS X Mountain Lion, choose Calendar > Preferences > General, or in OS X Lion, choose iCal > Preferences > Generaland under the Default Calendar heading, select one of the Calendars under the iCloud heading. Close the Preferences window to save this change.
    If recent changes simply don't appear, try forcing Calendar or iCal to refresh by selecting Refresh All from theCalendar menu.
    Make sure your account was successfully created in Calendar on your Mac (or iCal). After upgrading to iCloud Calendar, you may need to quit and reopen Calendar (or iCal). To confirm your account is configured correctly in iCal:
    Open Calendar (or iCal).
    Open Calendar (or iCal) Preferences.
    Click Accounts. You should see an account with your iCloud member name entered.
    Turn iCloud Calendars off and back on
    Quit Calendar (or iCal).
    Choose Apple () menu > System Preferences > iCloud.
    Remove the checkmark in the checkbox next to Calendars.
    Close System Preferences and wait about a minute.
    Open System Preferences and choose iCloud.
    Replace the checkmark next to Calendars.
    Close System Preferences.
    Open Calendar (or iCal) and test to see if the issue has been resolved.
    Restart your computer. This may sound simple, but it does reinitialize your network and application settings and can frequently resolve issues.
    Take care,
    Sterling

  • I have a problem with iCal.Since 2 days ago,I couldn't add new event in iCal on my ipad2.It Keeps saying 'No calendar has been set", then if I go to Calendar field,choose one calendar,it gives this msg "That event doesn't belong to that event store".

    I have a problem with iCal.Since 2 days ago,I couldn't add new event in iCal on my ipad2.It Keeps saying 'No calendar has been set", then if I go to Calendar field,choose one calendar,it gives this msg "That event doesn't belong to that event store". I can add event from iCloud and from my iCal on my iMac. Please help

    Most likely you have Office 2004 which are PPC-only applications and will not work in Lion. Upgrade to Office 2011. Other alternatives are:
    Apple's iWork suite (Pages, Numbers, and Keynote.)
    Open Office (Office 2007-like suite compatible with OS X.)
    NeoOffice (similar to Open Office.)
    LibreOffice (a new direction for the Open Office suite.)

  • How to delete events on iCal that were created many years ago with a MobileMe account?

    I have never ending recurring events on iCal that I created years and years ago with my MobileMe account.  I don't have access to that email anymore, unfortunately.  Is there any way to get rid of these silly things?

    Navi,
    What Calendars are listed in your sources pane?
    Where are they located?
    Are you using iCloud?
    Backup that specific calendar using Calendar>File>Export>Export..., and save the copy to your Desktop.
    What happens if you attempt to delete that specific calendar?

  • I can no longer create an event on iCal by double clicking on a time or date, nor can I double click on an existing event! HELP!

    I can no longer create an event on iCal by double clicking on a time or date, nor can I double click on an existing event! HELP!
    The only way I have to create an event is by using the "+" button, which is very limiting!
    I am running the latest version of Mac OS X and all the updates.
    Anyone know how I could get a proper use of my iCal ?
    Thanks

    Hi,
    If you list the steps you have taken to fix this it will help.
    Have you tried using the File > New Event menu item?
    Have you logged the user account out/ restarted the computer?
    Have you tried un-syncing any accounts synced to Calendar?
    Is there some change made to the computer that may have triggered this?
    Best wishes
    John M

  • Unable to add new event in iCal, Lion 10.7.1

    Hi,
    On Lion 10.7.1, I can't seem to add new events to iCal.
    I have tried the following:
    1. 2-finger click on a day in the month-view. This pops out the menu and I can click on 'New Event', but after that, nothing happens.
    2. Clicking on the '+' button at the top. This pops out the 'Create Quick Event' window. After typing in a new event and hitting return, nothing happens.
    I can create a new event in the 'Day' and 'Week' view though.
    iCal was working fine for me last week, but it seems to be broken since yesterday. I'm not sure if it stopped working after the 10.7.1 update.
    Thanks for any guidance or assistance!

    Solved! Needed to check "Show All Day Events" in the View menu!

  • Many years ago synced iCal with Microsoft program. Since installing Lion whenever I try to create an event in iCal it flashes up message "Unable to open Microsoft sync services Power PC applications no longer supported." How do I get rid of message?

    Many years ago synced iCal with Microsoft program. Since installing Lion whenever I try to create an event in iCal it flashes up message "Unable to open Microsoft sync services Power PC applications no longer supported." How do I get rid of message?

    Lion no longer supports PowerPC apps. If this is Microsoft Office 2008 (Entourage 2008) then you should disable the syncing services.  (I don't have Office 2008 installed anymore so I don't know exactly what it's called anymore.)  If you have Microsoft Office 2004 or earlier, then it can't be run on Lion at all since Lion removed Rosetta, which is what allowed a PPC app to run on an Intel based Mac.
    Also, I believe Microsoft removed sync services from the current Outlook 2011 (which replaces Entourage) so even upgrading to a newer version of Microsoft Office will not get you back that calendar sync feature.  Supposedly Microsoft is working on a new syncing system, but I wouldn't hold my breath.

  • Create new event for BOR object  for vendor creation

    Hello,
              I AM working on workflow.. Requrement is that , when a vendor is created I wanted the workflow to be triggered..
    But I dont find any bussiness object for this...
          Then I have created customized BOR object super type as LFA1. And created new event. Now I need to assign functionlity to this event, that is As soon as the vendor is created this event should be triggered so that I can use this as the start event for the workflow..
    Plz guide me ...
    Regards and Thanks,
    Poornima...

    Hi Poornima,
    Create a subtype and add the event in the BOR.
    Now call the FM  Userexit / BADI.
      CALL FUNCTION 'SAP_WAPI_CREATE_EVENT'
        EXPORTING
          OBJECT_TYPE             = 'ZKNA1'
          OBJECT_KEY              = OBJECT_KEY
          EVENT                   = 'ONSAVE'
    *   COMMIT_WORK             = 'X'
    *   EVENT_LANGUAGE          = SY-LANGU
    *   LANGUAGE                = SY-LANGU
    *   USER                    = SY-UNAME
    *   IFS_XML_CONTAINER       =
    * IMPORTING
    *   RETURN_CODE             =
    *   EVENT_ID                =
       TABLES
         INPUT_CONTAINER         = IT_CONTAINER
    *   MESSAGE_LINES           =
    *   MESSAGE_STRUCT          =
      IF SY-SUBRC <> 0.
        ENDIF.
    &******************Reward Point if helpful*************************&

  • Can't create new events or todos

    I am a frequent iCal / Mac user and have been using my Mac for the last year with no problem.
    Yesterday, I was no longer able to create new events or todos, in any calendar. When I click new event or new todo, there is no response (no window pops up, just ignores). When I drag an area in a day to create a new event, it shows the dragged time, then doesn't create the todo
    If I create an event or todo on my iPhone, it stays on my iPhone, but does not show up when syncing.
    Note all old events are still present. I can move an existing event to the future, so this shows edits are still possible.
    Can this be a recent bug from an pushed updated? Has anyone else seen this?
    I have rebooted and ensured all SW is up to date.
    Greg

    I am having the same trouble and just realized it yesterday. Can you provide the detailed steps you followed that I could try?
    I sync my calendar to MobileMe and my phone and those are both fine - and I've added new things to them since iCal stopped working apparently (guessing it was about a week ago based on things missing from iCal). I'm confused by your comment about backing up iCal - won't that simply end up restoring the same inaccurate data? Or maybe in my case it doesn't matter because the next time I sync it will update with the data I have on my phone and MobileMe (so maybe a dumb question). I already use Time Capsule so I'm guessing I can just use my most recent Time Capsule/iCal file backup to do my restore?
    I know very little about Terminal - not even enough to be dangerous! Are you saying in terminal you typed in that exact string you're showing below?
    Thanks!

Maybe you are looking for

  • My Apple Id was disabled and I do not know why.

    My Apple Id was disabled and I do not know why, I've already changed the password but to no avail, have bought several apps and games expensive, and so would not want to do another. What do I do?

  • File_file scenario

    Hi, After configuring the XI server I am doing first scenario in it that is file_file scenario. My problem is the file is not picking up. Is it configuration problem because even i checked in RWB there is no data coming. Even I checked in sxmb_moni i

  • COMBINED DIVISIONS ON A SALES ORDER REPORTING WRONGLY ON MC+2

    Hi All, The issue is that Multiple divisions on sales order reports to whichever header (division) the Sale Order is created with when reports are generated (drilled down by division) via MC+2 instead of reporting to the relevant division. SD expert,

  • My macbook pro 2006 fan goes high and then makes a fast beep and shuts down it been happening since i updated

    my macbook pro 2006 fan goes high and then makes a fast beep and shuts down it been happening since i updated it should i update to lion?

  • Bar Code  in laguage

    Hi, How to undarstand this bar code in SAPScript SE71 ? What is FT55 ,FS,FN  ? Like below code DFR:SSFMT000.ZPLFS / ^FT55,108 / ^CI0 / A0N,34,47FDShip To Party8 : ^FS / ^FT55,375 / A0N,34,47FDSupplying Site :^FS / ^FT54,504 / A0N,59,81FDHU Nos :^FS /