How to launch iCal on specified date from Cocoa app?

Hi, I would like to launch iCal from my Cocoa app, but have iCal open on a specific date that I want to pass as an argument.
I am launching iCal as follows:
[[NSWorkspace sharedWorkspace] launchApplication:@"iCal"];
This opens iCal fine. But, is it possible to somehow pass the date I would like iCal to open at?
Thanks indeed.
Andy

Third-party alternative to Scripting Bridge that may be of interest:
http://appscript.sourceforge.net/
More reliable, better documentation, better developer tools, supports back to OS X 10.3.9, yadda-yadda. Only relative disadvantage is that you have to bundle or install it yourself, but that's not hard.
Example:
// To create glue [1]: osaglue -o ICGlue -p IC iCal
ICApplication *ical = [ICApplication applicationWithName: @"iCal"];
NSDate *date = [NSDate dateWithString: @"2008-10-22 00:00:00 +0000"];
ICViewCalendarCommand *cmd = [[ical viewCalendar] at: date];
NSError *error;
id result = [cmd sendWithError: &error];
if (!result)
NSLog(@"%@", error);
Note that when building a framework for inclusion in an application bundle you need you tweak the build settings slightly, e.g. see:
http://cocoadev.com/index.pl?EmbeddingFrameworksInApplications
HTH
[1] Note: I'm currently integrating osaglue into ASDictionary to make it simpler to use, but haven't updated the old osaglue documentation yet. ASDictionary 0.12.0 should be released in another day or two; in the meantime I suggest just using the iCal glue files from the ViewCalendarInICal sample project in the objc-appscript repository.
Message was edited by: hhas

Similar Messages

  • How to Send the material master data from sap4.6c to ECC6.0

    Hi
        Friends this is shalini Shah, i got one requirement that is
    how to send the materail master data  from SAP 4.6C to ECC6.0 using XI.
    i  know the file to idoc and idoc to file scenarios but i don't know this one.
    please help me friends, Thanks in advance.
    Regards
    Shalini Shah

    Hi Shalini,
    To trigger IDoc these configurations should be done in the SAP 4.6, XI and ECC 6.0.
    SAP XI
    1) RFC Destination (SM59)
    a) Choose create.
    b) Specify the name of the RFC destination
    c) Select connection type as 3 and save
    d) In the technical settings tab enter the details SAP SID/URL and system number#.
    e) Enter the Gateway host as same details above SID/URL.
    f) Gateway service is 3300+system number#.
    g) In the Logon /Security tab, enter the client user & Password details of Destination system.
    h) Test the connection and remote logon.
    2) Create Port (IDX1)
    a) Select create new button
    b) Enter the port name as SAP+SID (The starting char should be SAP)
    c) Enter the destination client.
    d) Enter the RFC Destination created in SAP R/3 towards other system.
    e) Save
    3) Load Meta Data for IDOC (IDX2)
    a) Create new
    b) IDOC Message Type
    c) Enter port created in IDX1.
    SAP R/3 (4.6 and ECC 6.0)
    1) RFC Destination (SM59)
    a) Choose create.
    b) Specify the name of the RFC destination
    c) Select connection type as 3 and save
    d) In the technical settings tab enter the details SAP SID/URL and system number#.
    e) Enter the Gateway host as same details above SID/URL.
    f) Gateway service is 3300+system number#.
    g) In the Logon /Security tab, enter the client user & Password details of Destination system.
    h) Test the connection and remote logon.
    2) Create Port (We21)
    a) First Select Transactional RFC and then click create button
    b) Enter the destination port name as SAP+SID (The starting char should be SAP)
    c) Enter the destination client.
    d) Enter the RFC Destination created in SAP R/3 towards other system.
    e) Save
    3) Create Partner Profile (WE20)
    a) Create New
    b) Create the Partner no. name as same the logical system name of the destination system.
    c) Select Partner type LS
    d) Enter details for Type: US/USER, Agent, and Lang.
    e) Click on the + button to select the message type.
    f) Select Partner no. and LS which ever create above.
    g) Select Message type
    h) Select Process code related to the Message type.
    I) save.
    Also go ther the Blog <a href="/people/swaroopa.vishwanath/blog/2007/01/22/ale-configuration-for-pushing-idocs-from-sap-to-xi Configuration for Pushing IDOC's from SAP to XI</a> By Swaroopa Vishwanath
    U need to import the IDoc types both inbound and outbound to XI.
    1. Create Inbound and Outbound Message interface.
    2. Do one to one message mapping.
    3. Define an Interface mapping.
    ID:
    1. Create 1 Sender aggrement.
    2. Create 1 Receiver aggrement.
    3. Define 1 RD and ID.
    4. Only create an receiver IDoc CC.
    Regards
    San
    <a href="Remember to set the thread to solved when you have received a solution to set the thread to solved when you have received a solution</a>
    Where There is a <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/weblogs?blog=/weblogs/topic/16">blog</a> there is a Way.

  • How do i repair or recover data from a corrupt USB external hard drive that does not show up on my Mac desktop or disk utility

    How do i repair or recover data from a corrupt USB external hard drive that does not show up on my Mac desktop or disk utility?
    Last night i was using my external hard drive, for some reason the folder just closed and i couldn't find it on my desktop.
    After googling solutions, i found it in the disk utilities, i clicked on the 'repair' button many times, but it said the 'error...' message.
    So i ejected it to try again, now when i connect the USB external hard drive it doesn't show up on my desktop or disk utilities.
    I really just want to either repair or recover the data on it because it literally has everything (documents, work files, photos etc) on it,
    I downloaded an application to recover my files but it needs the USB to at least show up.recognise it which mine doesn't.
    I know i should've backed it up on another USB, this definitely teaches me for next time to back up all my files.
    Are the files lost forever or can i recover them by going to a shop or using a software?

    Thank you for responding.
    This might sound stupid since i'm not really knowledgeable with Macs,
    but since all my files were moved from my mac computer to the external hard drive,
    is it possible to recover those files through my Mac - like recovering deleted files? 

  • How can I restore the game data from an old ipod touch to a new one?

    How can I restore the game data from an old ipod touch to a new one?

    Restore it from the backup of the old ipod.

  • I have forgotten my password for icloud, have an invalid email address and do not know my security answers. How can I transfer all my data from my old iphone to the new one?

    I have forgotten my password for icloud, have an invalid email address and do not know my security answers. How can I transfer all my data from my old iphone to the new one?

    In this case you won't be able to do that?

  • How do you remove back up data from the memory storage? my storage data states that i have over 80gb of data used for back ups and i dont know why as i use a external hard drive as a time machine .now my 250gb flash storage is nearly full

    how do you remove back up data from the memory storage? my storage data states that i have over 80gb of data used for back ups and i dont know why as i use a external hard drive as a time machine .now my 250gb flash storage is nearly full.. HELP!

    When Time Machine backs up a portable Mac, some of the free space will be used to make local snapshots, which are backup copies of recently deleted files. The space occupied by local snapshots is reported as available by the Finder, and should be considered as such. In the Storage display of System Information, local snapshots are shown as  Backups. The snapshots are automatically deleted when they expire or when free space falls below a certain level. You ordinarily don't need to, and should not, delete local snapshots yourself. If you followed bad advice to disable local snapshots by running a shell command, you may have ended up with a lot of data in the Other category. Ask for instructions in that case.
    See this support article for some simple ways to free up storage space.

  • HT5824 How do I transfer all my data from iCloud to Samsung Note 3

    How can I transfer all the data from icloud or my Iphone 5s to Samsung Note 3?

    This explains how to archive and copy your icloud data: http://support.apple.com/kb/ht4910.  You'll have to consult with Samsung on how to transfer it to your Galaxy Note.

  • How do I transfer all my data from my Time Capsule 2TB to my new Time Capsule 3TB?

    How do I transfer all my data from my Time Capsule 2TB to my new Time Capsule 3TB?

    Click here and follow the instructions to move a Time Machine backup, and just drag-copy everything else.
    (113074)

  • How do I transfer all my data from my original iPad 1 to my new iPad Air?

    How do I transfer all my data from my original iPad 1 to my new iPad Air?

    Do a full sync and backup of your one. I use iTunes for all my backing up. Then unplug the one and plug in the Air. Go through the setup process and when you have the choice to 'set up as new or restore from backup' chooose the the restore and your air will be a near clone of your One. You will need to reset up wifi and website passwords, but the data should be there.
    Once you are sure the Air has all you need on it, you can go into the settings and 'erase all content and settings' which puts your One back to the 'out of box' state to you can sell it if you want.

  • How do I transfer all my data from my old windows laptop to my new MacBook

    How do I transfer all my data from my old windows laptop to my new MacBook

    Two knowledge base articles that may help are http://support.apple.com/kb/PH11393 and http://support.apple.com/kb/HT1408

  • How do i transfer all my data from one itouch to another?

    how do i transfer all my data from one itouch to another?

    Try here  >  http://support.apple.com/kb/HT2109

  • How do I transfer all my data from an iPad Air wifi 32 GB to a brand new iPad Air 2 64GB?

    I received right now a brand new iPad Air2 wifi 64 GB. How do I transfer ALL MY DATA from another iPad Air wifi 32 GB ?

    Back up your old one. I use and prefer iTunes, but back up all the data, etc.
    Then unplug it. Plug your new one in and go through the setup steps. When you see the option to set up as new or restore from the backup you just made, choose that and your new iPad will be a near clone of the old one.
    http://support.apple.com/en-us/HT2109
    has step to step instructions.
    If you are going to get rid of your old iPad, read this before you do so, just to make sure you're not inadvertantly selling someone a brick
    Selling an iPad
    http://support.apple.com/kb/HT5661

  • How do I transfer all my data from an iPad Air 32 GB wifi to a new iPad Air 2 wifi 64 GB?

    I received right now a brand new iPad Air wifi 64 GB.
    How do I transfer all my data from an iPad Air wifi 32 GB, with no more space in iCloud?
    Thanks a lot.

    iOS- Transferring information from your current iPhone/iPad/iPod touch to a new device
    Transfer content from an iPhone, iPad, or iPod touch to a new device
    iTunes Store- Transferring purchases from your iOS device or iPod to a computer
    How to re-download purchased apps from the App Store

  • Hi...i bought the new iphone 4 and would like to ask how can i transfer all my data from my old iphone to the new one?  If I will do "synchronization" through itunes with the old phone and the plug in the new one will that be the case?

    Hi...i bought the new iphone 4 and would like to ask how can i transfer all my data from my old iphone to the new one?  If I will do "synchronization" through itunes with the old phone and the plug in the new one will that be the case?

    Follow the instructions in this article to transfer your info: iPhone: Transferring information from your current iPhone to a new iPhone

  • How can I transfer all my data from my mac to my laptop

    Do anyone of you know how to transfer all my itunes data from my MAC to my laptop?
    Thanks,

    If you want Everything in iTunes...
    Copy your ENTIRE iTunes FOLDER to an External Drive... and then from the External Drive to your New Computer..
    iTunes to an External Drive
    http://support.apple.com/kb/HT1751
    An Added Bonus is that you will have a Backup of iTunes.
    There is also this...iTunes: How to move your music to a new computer

Maybe you are looking for

  • Date calculation in report

    Hi, in rpt i need to show the diff b/w 2 dates. i.e., (END_DATE- START_DATE). so i have created 2 formula variables on END_DATE- START_DATE. i just wanna confirm whether i created it properly or not. Procedure: Under Formula Variable-->New Variable.

  • Windows 7 64bits + Iphone + Socket 1156

    Hello, I have received today my iphone 3GS 32GB, But I have a problem! I have a Windows 7 64 bits, Asus maximus III Formula (Socket 1156). Itunes is installed correctly (and reinstalled), my old IPHONE 3G isn't recognized by the computer (Error :Ex08

  • ITunes wish list works on Windows PC, not iPad?

    Really?  Or am I missing some link?  I am fairly new to Apple products.

  • Pages not loading / loading slowly / flashing on and off

    MacBook Pro OS X 10.5.8 Safari 5.0.6 I have had trouble with loading pages on Safari lately on my MacBook Pro. Some take forever to load, and when they do, they load either incomplete, or not at all, leaving a white screen (even when some images appe

  • Calendars in Outlook 2010 won't sync with my iPhone 3gs

    Since I installed iOS 4.3 in my iPhone 3GS I cannot get iTunes 10.4 to sync my Calendars in Outlook 2010 with my iPhone.  I have not changed any settings and it has worked without problems for the last year until I installed iOS 4.3 Can anyone help m