Results 1 to 8 of 8
  1. #1
    Create Calendar entries from text file
    I have a text file (either Pages or Numbers) with dates, times, etc, and I'd like to create an entry in my Calendar from each line. Is there a way to do this?

    Mac OS 10.13.6
    Pages 8.1
    Numbers 6.1

  2. #2
    Create Calendar entries from text file
    Raz0rEdge's Avatar
    Member Since
    Jul 17, 2009
    Location
    MA
    Posts
    12,329
    Rep Power
    24
    You can use AppleScript to do this with something like this
    Code:
    • set theStartDate to (current date) + (1 * days)
    • set hours of theStartDate to 15
    • set minutes of theStartDate to 0
    • set seconds of theStartDate to 0
    • set theEndDate to theStartDate + (1 * hours)
    • tell application "Calendar"
    • tell calendar "Project Calendar"
    • make new event with properties {summary:"Important Meeting!", start date:theStartDate, end date:theEndDate}
    • end tell
    • end tell
    This, obviously, is not reading from the file, but you can use something like the following for that
    Code:
    set srcFile to ((path to desktop) as text) & "myFile.txt"
    
    
    # Read lines from file.
    set lns to paragraphs of (read file srcFile as «class utf8»)
    
    
    # Loop over lines read and copy each to the clipboard.
    repeat with ln in lns
        set the clipboard to ln
        display alert (the clipboard)
    end repeat
    So you could combine some combination of these two scripts to get what you want.
    --
    Regards
    ...Ashwin


  3. #3
    Create Calendar entries from text file
    badshoehabit's Avatar
    Member Since
    Aug 02, 2011
    Location
    Tyneside, UK
    Posts
    1,652
    Your Mac's Specs
    MBP Retina mid 2015 15.4" 16GB 2.5 GHz OS Catalina; iPhone 7 128gb; iPad Mini 2, 32gb
    Rep Power
    10
    Highlight the date and right click gives the option of opening Calendar.

    Screenshot 2020-01-23 at 14.00.47.png
    Sue

    If the shoe fits, buy it in every colour.

  4. #4
    Create Calendar entries from text file
    Raz0rEdge's Avatar
    Member Since
    Jul 17, 2009
    Location
    MA
    Posts
    12,329
    Rep Power
    24
    Awesome solution Sue if the OP has a handful of things to add. But might get cumbersome if it's hundreds of entries.
    --
    Regards
    ...Ashwin


  5. #5
    Quote Originally Posted by Raz0rEdge View Post
    You can use AppleScript to do this with something like this
    Whoa! That's way above my understanding and capability. Is there no other way?

  6. #6
    Create Calendar entries from text file
    Raz0rEdge's Avatar
    Member Since
    Jul 17, 2009
    Location
    MA
    Posts
    12,329
    Rep Power
    24
    Quote Originally Posted by tobindia View Post
    Whoa! That's way above my understanding and capability. Is there no other way?
    If this is a one time thing, then follow badshoehabit's idea.
    --
    Regards
    ...Ashwin


  7. #7
    Quote Originally Posted by badshoehabit View Post
    Highlight the date and right click gives the option of opening Calendar.
    I couldn't replicate your action, but even so it seems like that will only open the Calendar, not fill in the Event, Start Time, Notes, etc. Also, I would have to do it manually, one Calendar entry at a time, which I'm trying to avoid. Thanks anyway, badshoehabit.

  8. #8
    Create Calendar entries from text file
    Raz0rEdge's Avatar
    Member Since
    Jul 17, 2009
    Location
    MA
    Posts
    12,329
    Rep Power
    24
    Quote Originally Posted by tobindia View Post
    I couldn't replicate your action, but even so it seems like that will only open the Calendar, not fill in the Event, Start Time, Notes, etc. Also, I would have to do it manually, one Calendar entry at a time, which I'm trying to avoid. Thanks anyway, badshoehabit.
    Correct, the method suggested will bring you to a specific date in Calendar. You are still required to actually create the event.

    If you can provide a sample text file which has your data, I can put something together for the AppleScript to add them to Calendar.
    --
    Regards
    ...Ashwin


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Cant see calendar entries
    By Wendyaaf in forum macOS - Operating System
    Replies: 1
    Last Post: 05-22-2015, 08:05 AM
  2. Calendar entries are GONE
    By Jgassaway in forum iPad Hardware and Accessories
    Replies: 6
    Last Post: 06-12-2010, 05:10 PM
  3. How do I create a simple text file?
    By tenover in forum Switcher Hangout
    Replies: 2
    Last Post: 04-17-2007, 02:04 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •