Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8277253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T08:38:12+00:00 2026-06-08T08:38:12+00:00

i need to create application which export all iCal events to isc file.Can you

  • 0

i need to create application which export all iCal events to isc file.Can you advice me how i can to do? With Cocoa Application, Command Line Tool or AppleScript Application?….I am trying to do this with AppleScript Application, using CalendarStore Framework.I’m able to get all events, but how to save thems to ics file??

Here is my code:

    - (IBAction)btnSelector:(id)sender {
CalCalendarStore *calendarStore = [CalCalendarStore defaultCalendarStore];
NSDate *startDate=[[NSDate alloc] init];
NSDateFormatter *formatter = [[NSDateFormatter alloc] init] ;
[formatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
startDate=[formatter dateFromString:@"2010-01-01 00:00:00"];                             
NSDate *endDate=[[NSDate alloc] init];    
 endDate=[formatter dateFromString:@"2050-01-01 00:00:00"];

 NSArray *calendars = [calendarStore calendars];
    NSPredicate *allEventsPredicate = [CalCalendarStore eventPredicateWithStartDate:startDate endDate:endDate calendars:[calendarStore calendars]];

NSArray *events = [calendarStore eventsWithPredicate:allEventsPredicate]; 

for(CalEvent *event in events)
{
    //here i must save event to file...
    NSLog(@"%@",event);
    }

for (CalCalendar *calendar in calendars) {

    self.lblNotification.title=[NSString stringWithFormat:@"%@  %@",self.lblNotification.title,calendar.title];

}

 }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T08:38:14+00:00Added an answer on June 8, 2026 at 8:38 am

    I solved the problem…now i don’t use CalendareStore framework, i just read content of calendars folder:

    NSFileManager *fileManager = [[NSFileManager alloc] init];
    //   /Users/username/Library/Calendars
    NSError *err;
    
    NSArray *usersFolder = [fileManager contentsOfDirectoryAtPath:@"/Users" error:&err];
    
    for (NSString *dirElement in usersFolder) {
       // NSLog(@"users folder : %@",dirElement);
    
        NSString *userCalendarPath = [NSString stringWithFormat:@"/Users/%@/Library/Calendars",dirElement];
        NSArray *contentCalendarDirectory = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:userCalendarPath error:nil];
        NSArray *calendarFolders = [contentCalendarDirectory filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"self ENDSWITH '.calendar'"]];
    
        NSMutableArray *calendarNames= [[NSMutableArray alloc]  init];
    
        for(NSString *calendarFolder in calendarFolders)
        {
           // NSLog(@"calendar folder %@/%@",userCalendarPath,calendarFolder);
    
            NSString * fullCalendarInfoPath = [NSString stringWithFormat:@"%@/%@/Info.plist",userCalendarPath,calendarFolder];
            NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile: fullCalendarInfoPath];
    
    
            NSString * eventsDirectory = [NSString stringWithFormat:@"%@/%@/Events",userCalendarPath,calendarFolder];
            NSArray *contentEventsDirectory = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:eventsDirectory error:nil];
            NSArray *events = [contentEventsDirectory filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"self ENDSWITH '.ics'"]];
    
    
            for(NSString* eventName in events)
            {
                NSString * eventPath = [[NSString alloc] initWithFormat:@"%@/%@/Events/%@",userCalendarPath,calendarFolder,eventName];
                 //this array contain all ics paths...
    //to read file content:
    //NSString *eventContent = [[NSString alloc] initWithContentsOfFile:eventPath encoding:NSUTF8StringEncoding error:nil];
                [eventsPath addObject:eventPath];
    
              }
             NSString* calendarTitle = [dict objectForKey: @"Title"];
    
            [calendarNames addObject:[NSString stringWithFormat:@"%@  (%lu events)",calendarTitle,[events count]]];
    
        }
        if(calendarNames.count>0)
        { 
           NSDictionary *userCalendars = [NSDictionary dictionaryWithObjectsAndKeys:dirElement,@"parent",calendarNames,@"children", nil];
           [dataCalendars addObject:userCalendars];
           }    
             }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to create a flash projector application which can be interacted with, but
I need to create a application which is similar to those we will get
I am developing an web application which can upload/download a file from client to
I need to create application in which one textview are there to search any
I need to create an ActionResult in an ASP.NET MVC application which has a
Do I need to create a application pool which supports .net framework 4.0?
I need to create an application which should send some information to the PC
I need to create an application which do the following: At the beginning we
I need to create an application in which we are changing the style of
I need to create an application which is similar to google docs. I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.