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 8339265
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T04:50:20+00:00 2026-06-09T04:50:20+00:00

I made this code that its supposed to parse a given string separated by

  • 0

I made this code that its supposed to parse a given string separated by “/” with the message, day and time, then make a Reminder in Mountain Lion Reminders.app.

My problems comes when Reminders doesn’t seem to like the date I’m passing to it for no good reason.

I get this error message:

Invalid date and time date August 6 2012 6:00pm of list Reminders.

Here’s my code:

--explode © 2008 ljr (http://applescript.bratis-lover.net)
on explode(delimiter, input)
local delimiter, input, ASTID
set ASTID to AppleScript's text item delimiters
try
    set AppleScript's text item delimiters to delimiter
    set input to text items of input
    set AppleScript's text item delimiters to ASTID
    return input --> list on error eMsg number eNum
    set AppleScript's text item delimiters to ASTID
    error "Can't explode: " & eMsg number eNum
end try
end explode

--reminders © 2012 Jonathan Wiesel (http://github.com/jonathanwiesel)
set myList to explode("/", "visit my mom/today/6:00pm")
set theReminder to item 1 of myList
set queryDay to item 2 of myList
set theHour to item 3 of myList
set theYear to year of (current date)
if queryDay = "today" then
   set theDay to day of (current date) as string
   set theMonth to month of (current date)
   set theDate to theMonth & " " & theDay & " " & theYear
else if queryDay = "tomorrow" then
   set theDay to (day of ((current date) + (24 * 60 * 60)))
   if (day of (current date)) < (day of ((current date) + (24 * 60 * 60)))
        set theMonth to month of (current date)
    else
        set theMonth to (month of ((current date) + (30 * 24 * 60 * 60)))
    end if     
       if year of (current date) < year of ((current date) + (24 * 60 * 60)) then
    set theYear to (year of (current date)) + 1
    set theDate to theMonth & " " & theDay & " " & theYear & " "
   else
    set theYear to year of (current date)
    set theDate to theMonth & " " & theDay & " " & theYear & " "
   end if
else
   set theDate to queryDay
end if

set stringedDate to theDate as string
set stringedHour to theHour as string
set stringedAll to stringedDate & " " & stringedHour
tell application "Reminders"
tell list "Reminders"
    make new reminder with properties {name:theReminder, due date:date stringedAll}
end tell
end tell
  • 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-09T04:50:22+00:00Added an answer on June 9, 2026 at 4:50 am

    Well there is a good reason. You are telling the Reminders application to convert the date in string format to a date object. Reminders does not know how to do that. Applescript does. So just change your last few lines of your script to make applescript do it as follows. Basically you should never tell an application to do something that is not in its applescript dictionary.

    set stringedAll to date (stringedDate & " " & stringedHour)
    tell application "Reminders"
        tell list "Reminders"
            make new reminder with properties {name:theReminder, due date:stringedAll}
        end tell
    end tell
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I found this piece of Java code at Wikipedia that is supposed to shuffle
I have made this code: var foo=document.createElement(div); var childs=foo.getElementsByTagName(*); console.log(childs.length);//0 OK var a=document.createElement(a); foo.appendChild(a);
I have made this code to open a database(created in SQLite browser) stored in
How can I improve this code? What has made this long winded is the
I am pretty new at C# and .NET, but I've made this code to
I have a problem, and I made this test code to show you my
I've made this piece of code, it will re-size images on the fly, if
Ok. I've made this awe-crap-code Exporting table to XLS (but still no idea how
I have a line, which is a sprite made by using this code CGPoint
I made this little function from code snippets around the net. It does what

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.