ICal scripting

Hi there
It's been 2 days now that I decided to make a script for an automation of iCal, and I give up ;p.
First of all, can anyone tell me where can I find a complete reference of the iCal scripts (i.e. all the objects and methods that are scripted in iCal, like the "calendar" object).
What I want to do, is to export all my calendars to a specific location (I'm lookinf fot the export methods using applescript). Does anyone has a hint?
Thx a lot
iMac 24' 2,16GHz CodeDuo2 GeForce 7300 GT 1Gh DDR   Mac OS X (10.4.8)  

One problem for sure, and perhaps one other problem, too.
The first problem is you need to have an ellipsis in the name of the menu item. If you look in iCal's File menu, you'll see the menu item name is actually "Export…" with an ellipsis at the end (no spaces).
You can copy paste the ellipsis from this message. On a U.S. keyboard, you can hold the Option key and press the semicolon ( ; ) to get an ellipsis. In the Edit menu of most apps, you can choose "Special Characters…" at the bottom of the menu to show the Character Palette. Or you can show the Input Menu in the menu bar by selecting it in International Preferences in System Preferences, in the Input Menu tab. In there, the option to show the Input Menu is at the bottom of the window, and the palettes are at the top as one of the first three items in the list. The Input Menu is completely customizable by selecting anything from the list. You may also find the Keyboard Viewer useful (one of the three) to have in the Input Menu. When you press modifier keys (Command, Option, Control, Shift, or a combination) the Keyboard Viewer will show what each key will type when pressed.
As for the Character Palette, you can select one of the ellipses in this message (such as double-clicking this one: … ) and then choose from the action button in the lower left corner of the palette (button with gear and triangle) the "Show Character Selected in Application" option. (Or look in the Punctuation category, near the top, it's the eighth character for me). Then just add it to your favorites using the same action button. Double-clicking a character will insert it wherever the cursor happens to be in whatever application is currently foremost.
You can also use the zoom button (green button) in the Character Palette's title bar and it'll become very small showing only the character you have selected. Now you won't have to double-click, just single click the character.
The other thing you'll want to do is make sure you've selected "Enable access for assistive devices" in the Universal Access preferences in System Preferences. That is required when you are gui scripting with AppleScript, such as using System Events to select menu items and buttons and such.
You'll find closing the iCal window to be ineffective since it has to be open when exporting since you are using gui (graphical user interface) scripting. You'll also need to select the calendar before exporting, which will require further gui scripting since that's not an option in iCal's dictionary. You'll also need to press the "Export" button in the exporting dialog, and perhaps change the name and location if desired.
At that point, you'll probably want to post in the AppleScript forums to get more variety of help with gui scripting since this doesn't really have anything to do with Automator anymore.
http://discussions.apple.com/forum.jspa?forumID=724

Similar Messages

  • ICal scripting an alarm

    I have events in a calendar set up to email an alarm for when I need to service certain machines that are under a service agreement. Then the person will log the call using the system number that I have in notes from their email.
    I am trying to eliminate the person and have the call automatically logged and print out.
    AS can't get anything out from the notes so I thought I would put the system number in the location field so I could get it.
    I need to write a script that will be triggered from an iCal alarm and then go and get the system number out of the location field for that event when it comes up.
    but I am having trouble trying to get the current event in iCal.
    I am not sure if I explained this very well but
    I just need a way to get a number from the current event that triggered the alarm so I can add it to the rest of my script.
    Thanks
    darock

    There is no current event in iCal. Austin Kinsella posted a work around in this thread.
    http://discussions.apple.com/thread.jspa?messageID=1340164&#1340164

  • ICal scripting problem

    Hi everyone,
    I'm trying to write a brief .ics script to input my entire shift pattern into iCal and I'm making some headway although struggling with the last 5%.
    I work 6 on 4 off, 2 earlies, 2 lates, 2 nights then 4 days off. No problem, I've written 6 events, each that are repeated daily with a 10 day interval.
    The problem lays in the fact that the shifts that land on a Thursday, Friday or Saturday, the time of the shift changes.
    Now it would be ideal if RRULE:FREQ=DAILY;BYDAY=MO,TU,WE,SU;INTERVAL=10 worked, that'd be great! Because I could just write a second event to place the events on the friday/sat/sun.
    So I've sort of abandoned that idea.
    So now I'm looking at placing a new event, repeating weekly, by day, and using the userID and editing a day. I.e if I set the UID of both early shifts as GPCJ-Early. Then I write an 'edit' script to run on Thurs,Fri,Sat and edit any GPCJ-Early to 07-1800 and so forth for the other shifts, that would also work.
    Am I missing something glaringly obvious and a better way of achieving this? I just need to place events that repeat every 10 days, except with different times if it's a thursday, friday or saturday.
    I'm testing it on phpicalendar 1.1 and I assume there must be some sort of syntax error (although it validates online) because iCal on my girlfriend's iMac says that the file is unusable. I'll cross that bridge later though!
    Appreciate any help you can offer, technical documentation on iCal programming seems incredibly sparse!
    Gareth

    iCal takes its format from System Preferences>Language& Text>Formats.
    Click on the 'Customize' button for 'Time' and set as here:
    Then drag the  'PM' button in the 'Time Elements' section to after the short time - though when I tried this it didn't appear in iCal. You may need to experiment a bit.

  • ICal Script

    Does anyone know of a script to minimize iCal at start up. I want it to open when I turn my computer on but don't up on my screen when I turn it on. Just on in the dock. Also, how do you add birthdays on the birthday tab, it won't let me.

    In the Accounts pane of System Preferences, select iCal in the list of login items for your account and check the Hide box. If for some reason this doesn't work, open the Script Editor in the /Applications/AppleScript/ folder and enter the following:
    tell application "iCal" to run
    delay 1--number may need to be adjusted
    tell application "System Events"
    set visible of process "iCal" to false
    end tell
    Save it as an application, and replace iCal with it in the list of login items.
    (23386)

  • ICal corrupt after script from Omni

    I ran an export to iCal script from Omnioutliner 3.03 and this created an extra calender (named after the omni file it came from). During the export the system crashed and since then iCal has become unstable.
    The new calender cannot be deleted and after I start up iCal it freezes after a few minutes.
    Going to /Library/Application Support/iCal/Sources/ shows me a folder for each calender and if I delete the one that is causing the problemens it dissapears in iCal..... for a while and then it mysteriously comes back.
    iCal behaves nicely until it comes back and then it's all wanky again.
    How do i restore iCal to its usual stable self again?

    Hi kimal,
    Are you syncing the calendars? Run Script alarms only work on local calendars, those under "On My Mac" in iCal.
    Best wishes
    John M

  • Scripting iCal and TextEdit

    Is it possible to add Scripts menu to iCal, like it is to iTunes? (I created an empty ~/Library/iCal/Scripts directory and restarted iCal - nothing happened.) Same question for TextEdit.
    In general, how do I find out those things?
    Thanks!

    If you are talking about the Script Menu shown via the AppleScript Utility, the place to add scripts is the ~/Library/Scripts/ folder (for example, ~/Library/Scripts/Applications/iCal). There are several articles that can be found via Google, as well as searching Apple's support files with terms such as script menu.

  • Duplicate ical alarms using external boot drive

    I have an external firewire drive that I boot Leopard from. I carry it between home and work. At both home and at work I have similar, but not identical Mac Pro (Intel) desktop machines that stay put. In either location I can just boot from my external firewire drive and have all my OS environment and files with me. I've been doing this for months.
    Every since I've set it up, though, I have had a problem with iCal alarms. If an iCal alarm goes off, say, while I'm using my external HDD at home, and I dismiss it, it never shows up again at home, even if I reboot. But if I then take the HDD into the office and boot from the external HDD there, all the alarms that went off and were cleared at home, show up all at once when I boot up at work. It also happens in reverse -- alarms cleared at work show up the next time upon boot at home. Note that I'm running from the same boot disk in both cases. I don't sync multiple calendars with .Mac.
    This is particularly annoying because I have some automator ical scripts that are triggered once/day and if they run at home late at night, I don't want them running again when I boot up the next morning at work.
    Anyone know a fix/workaround for this. I searched the iCal prefs, iCal help, this discussion list, and did a google search to no avail.

    You can use the hardware, but will have to repartition and reinstall the OS from the disk shipped with the new Mac Mini.
    http://docs.info.apple.com/article.html?artnum=303220
    If you create a disk image of the Lacie on your Mini, you can later use setup assistant to restore users and applications from that image.

  • Record TV from Cable Box via Firewire

    So I have a cable box capable of outputting Tv via Firewire. I have the cable, and using iRecord I can record TV, but it is very cumbersome. I was wondering if anyone could give me a working link to Ical scripts that will launch a AVCVideoCap recording. the link is http://machdtvtimer.home.comcast.net/ but it does not work.

    See this link:
    http://macteens.com/index.php/features/fullstory/howto_make_your_own_home_theatre_machtmac/
    I haven't tried it, but have always wanted to.

  • Integrating a Applescript in to a CRON job, possible? How to?

    Is it possible to set up a cron so a script runs every day (if the machine is on) triggered by the cron.
    If so I like some instructions as to what to write in the cron to trigger the script. and should I safe the script as run only for it to work?
    thanks

    Sorry for the delay but found myself unexpectedly on a operation table with 2 people cutting in to my hand. all is well and learning for now to type with 5 + 1 fingers till all recovers and we return to 5+5 .
    It does not work, I use CroniX to set up the job.
    When I schedule it it does not run. I have (scheduled to run every 30 minutes past the hour like this - 30 * * * *) with this command:
    usr/bin/osascript "/Users/861user/Desktop/Alarm-Mail-Ical scripts/System/ Shut Down Failure make 3 pics and send.scpt"
    alternative is:
    usr/bin/osascript /"/Users/861user/Desktop/Alarm-Mail-Ical scripts/System/ Shut Down Failure make 3 pics and send.scpt"
    Result ditto. I tried it as a user cron and a root cron, same result.
    when I use the 'Run Now' button in CroniX it works (both variations. Without the " before and after the path as suggested it does not run. So me puzzled, any ideas?

  • Setting "automator" for a task

    hello, i'm not sure if it's a software bug or what but it seems this issue is still going on. my volume reverts back to internal speakers when awaking from sleep even though line out is selected. i go into prefs and select line in, then line out and i have volume on my external speakers.
    can i have automator do this for me when awaking from sleep? i've never used automator before so i'm a newbie.
    thx

    I have a similar problem with my new Mac Pro. I thought that it might be an issue with either Snow Leopard, which I hadn't had before, or with the Mac Pro. I thought I had found the problem: that I was using the old Apple sphere speakers that get their power via FireWire. Since this computer has no FW400 ports, I have the speakers' FW plugged into an external drive. Prior to this I had an iMac with FW400 ports. So I thought that it wasn't being recognized by the Sound Preferences as being plugged in upon startup since the drive starts just a hair after the computer. My solution was to do an Automator workflow for iCal since my computer is scheduled to come on at the same time every day. I scheduled the iCal script to run a few minutes after scheduled startup.
    There were a couple of things to figure out there I tried doing it all with the Watch Me Do. Unfortunately, it always screwed up which menu item to choose when I used a drop down menu to open System Preferences. I solved that by using the Launch Application command, and chose System Preferences. Then I recorded the rest of the actions, and that worked.
    My only problem now is that every time I restart or startup the computer manually, the Sound Pref reverts back to Internal Speakers. It seems to be fine awaking from sleep. The selection of Line Out is retained.
    I was an old QuicKeys user, and with that, you were able to set conditions like upon startup, upon waking up, and that sort of thing. I don't see that in Automator. I saw recently that QuicKeys is available for OS X now. I may check that out. The old versions worked great.

  • How to hide grey sleeping hours?

    I've searched for this problem and the only other thread was resolved without posting a solution...
    In the preferences I'm able to change the number of hours displayed but cannot find a way of not display 11pm to 8am hours which are in grey.
    iCal v 4.0.4
    Thanks,
    Patrick

    Hi Patrick,
    Take a look at my 'Visible Day in iCal' script on this page:
    http://www.nhoj.co.uk/blog/2010/06/olderscripts
    Best wishes
    John M

  • Client for the mac, and more

    hi all i am willing to write code, and create a tool that runs on the same server as the cal. this code would get the data and convert it to ical format, which would then sync up with all the clients out there.
    the company i work for is interested in getting sun cal server for about 7000 users, but we cant do that unless there is a client that will talk to it directly, outlook is not an option.
    if any of you know of a client out there, (with the exceptiopn of glow) please let me know. i will try to help that project out, or perhaps just create that ical script that runs every time i log in via my ical client......
    ideas ????

    I am currently using this to subscribe to my server calendar.
    http://www.earlham.edu/~littejo/software/icald.shtml
    It seems to work well for me but I think there is always room for improvement.
    If you read the pod doc it lists some issues that exist between the two technologies. (WCAP vs iCal subscribe and publish)
    I think it may be a good starting point for you.
    You may want to review the following doc.
    http://developer.apple.com/internet/appleapplications/icalendarfiles.html
    I am willing to assist in any way I can.

  • Working with Excel 2008

    Couple of questions... can't seem to activate different worksheets within a workbook. Do I just call them by name? i.e.
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 720px;
    color: #000000;
    background-color: #FFDDFF;
    overflow: auto;"
    title="this text can be pasted into the Script Editor">
    activate object workbook "09-10 Teacherdata.xlsx"
    activate worksheet "sheet 1" </pre>
    if I have multiple ones is it just sheet1, sheet 2... or whatever I name them?
    2nd question...I'd like to open an excel file using a list to allow me the ability to call different file names within a loop. Can;t quite get it to work...something like this?
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 720px;
    color: #000000;
    background-color: #FFDDFF;
    overflow: auto;"
    title="this text can be pasted into the Script Editor">
    set deptname to {"English", "Humanities", "Mathematics", "Language", "Science", "Arts"}
    set deptnamefile to {"MacBook HD:Users:Dano:Desktop:English Schedules 10-11.xlsx", "MacBook HD:Users:Dano:Desktop:Humanities Schedules 10-11.xlsx", "MacBook HD:Users:Dano:Desktop:Mathematics Schedules 10-11.xlsx", "MacBook HD:Users:Dano:Desktop:Language Schedules 10-11.xlsx", "MacBook HD:Users:Dano:Desktop:Science Schedules 10-11.xlsx", "MacBook HD:Users:Dano:Desktop:Arts Schedules 10-11.xlsx"}
    repeat with i from 1 to 6
    if item 5 of cvalue = item i of deptname then
    copy item 2 of cvalue to slotvalue
    tell application "Microsoft Excel"
    activate
    open file item i of deptnamefile
    activate object workbook item i of deptname & "Schedules 10-11.xlsx"
    </pre>
    Thanks in advance for the help!
    dan

    Hi Bernard,
    Thanks for the response. You helped me about a year ago on some iCal scripting that worked out great, Thanks again! With Excel I have a set of data that looks like this 20501,B,T1441,101 where the items are unique id # for an academic class, slot during the day when the class is taught (ranges from A to H), Teacher id #, second unique id # for the academic class. I have written a script that puts in a 5th piece of info of the academic department name based on the unique id (works fine), and was then trying to move the data into an series of worksheets (one for each academic department) which would give me a visual of the teacher's schedule during the week. The excel file is set up to do this based on the occurrence of the teaching slots that show up in row 3, columns J through Q. So I have 6 different Excel files (6 academic departments) with each file having 10 or so sheets in them (each sheet for a unique teacher). Looking to get the data out of the original Excel file (20501,B,T1441,101) and into the department files, specifically into row 3, columns J through Q. Here is the full script of what I have attempted. I disabled the "open file item i of deptnamefile" since I couldn't get it to work and was playing around with just getting the script to move some of the data over into those department specific files when I posted the question. Any insight would be appreciated.
    dan
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 720px; height: 340px;
    color: #000000;
    background-color: #FFDDFF;
    overflow: auto;"
    title="this text can be pasted into the Script Editor">
    -- Works with an already opened Excel file [csv is ok] to move a scheduled sections into a daily Schedule  for the courses taught by a teacher.  Each Excel file will be dept based and have multiple workbooks
    tell application "Microsoft Excel"
    activate
    open file "MacBook HD:Users:Dano:Desktop:09-10 Teacherdata.xlsx"
    activate object workbook "09-10 Teacherdata.xlsx"
    activate object worksheet "Sheet 1"
    get value of used range of worksheet 1 of file "MacBook HD:Users:Dano:Desktop:09-10 Teacherdata.xlsx"
    copy the result to wholedata
    set lvalue to length of wholedata
    set counter to lvalue
    set cellnum to 1
    set cellid to ""
    set slotvalue to ""
    repeat with i from 2 to counter
    set cvalue to {0, 0, 0, 0, 0}
    copy item i of wholedata to cvalue
    set deptname to {"English", "Humanities", "Mathematics", "Language", "Science", "Arts"}
    set deptnamefile to {"MacBook HD:Users:Dano:Desktop:English Schedules 10-11.xlsx", "MacBook HD:Users:Dano:Desktop:Humanities Schedules 10-11.xlsx", "MacBook HD:Users:Dano:Desktop:Mathematics Schedules 10-11.xlsx", "MacBook HD:Users:Dano:Desktop:Language Schedules 10-11.xlsx", "MacBook HD:Users:Dano:Desktop:Science Schedules 10-11.xlsx", "MacBook HD:Users:Dano:Desktop:Arts Schedules 10-11.xlsx"}
    set columnchoices to {"J", "K", "L", "M", "N", "O", "P", "Q"}
    set teachingslot to {"A ", "B ", "C ", "D ", "F ", "G ", "H "}
    repeat with i from 1 to 6
    if item 5 of cvalue = item i of deptname then
    copy item 2 of cvalue to slotvalue
    tell application "Microsoft Excel"
    activate
    open file "MacBook HD:Users:Dano:Desktop:English Schedules 10-11.xlsx"
    ---open file item i of deptnamefile---
    activate object workbook "MacBook HD:Users:Dano:Desktop:English Schedules 10-11.xlsx"
    activate object workbook item i of deptname & "Schedules 10-11.xlsx"
    repeat with i from 1 to 7
    if slotvalue = item i of teachingslot then
    set cellid to item i of columnchoices & "3"
    set formula of cell cellid to item i of teachingslot
    end if
    end repeat
    end tell
    end if
    end repeat
    end repeat
    set onepiece to {}
    set lastrow to {}
    set courseID to {}
    end tell </pre>

  • Add Calendar Event from Email Recieved

    When I recieve an email, how do I add it to a Calendar event? I am not talking about accepting a invite, but when I recieve an email and I want to follow up to that email at a specific date and time. How can this be done in mail?

    Take a look at this.
    http://www.hawkwings.net/2005/09/17/ical-scripts-for-apple-mail/

  • Ical print scripting

    Hi, i was wondering if anyone knows how to write a script to make ical print out my scedual for the week. I have looked up scrpts for prtining and saving and all that stuff and i can get them to run both as applications and scripts in new events in my calender but i do not know how to make it print out the scedual. I assume that i would have to first save the calender and then print it so im lost. Thanks for the help -mike
    macbook pro   Mac OS X (10.4.8)  

    It would not, I think, be an easy task. There is no way, AFAIK, to ask iCal to save the equivalent of the week display as a separate file. It would be possible to do it with GUI scripting, but this is not easy and generally not considered reliable.
    AK
    [Edit]
    You could take a look here - John Maisey has posted a script to print a daily schedule automatically.

Maybe you are looking for