How do I find out the ID of a reminder created with an applescript?

I created an applescript to create a reminder from Quicksilver, but I want it to show the reminder once it has been created if Reminders was already open. If I use this, then another reminder with the same name sometimes gets shown. How do I find out the ID of a reminder when I create it and set it to a variable so that it will select the reminde I want it to, and if this is not possible, how should I do it?
Here is the applescript:
using terms from application "Quicksilver"
          on process text reminderData
                    if reminderData is "help" then return "Syntax: \"Name:Priority Time Date List Notes\""
                    set isName to true
                    set isPriority to false
                    set hasBeenPriority to false
                    set priorityEntered to false
                    set isTime to false
                    set hasBeenTime to false
                    set timeEntered to false
                    set isDate to false
                    set hasBeenDate to false
                    set dateEntered to false
                    set isList to false
                    set hasBeenList to false
                    set listEntered to false
                    set isNotes to false
                    set reminderName to ""
                    set reminderPriority to ""
                    set reminderTime to ""
                    set reminderDate to ""
                    set reminderNotes to ""
                    set reminderList to ""
                    set reminderDataCharacters to the characters of reminderData
                    repeat with i from 1 to number of items in reminderDataCharacters
                              set currentItem to item i of reminderDataCharacters
                              if isName is false and hasBeenPriority is false then set isPriority to true
                              if hasBeenPriority and hasBeenTime is false then set isTime to true
                              if hasBeenTime and hasBeenDate is false then set isDate to true
                              if hasBeenDate and hasBeenList is false then set isList to true
                              if hasBeenList then set isNotes to true
                              if isName then
                                        if currentItem is ":" then
                                                  set isName to false
                                        else
                                                  set reminderName to reminderName & currentItem
                                        end if
                              end if
                              if isPriority then
                                        if currentItem is "!" or currentItem is "-" then
                                                  if currentItem is "!" then set reminderPriority to reminderPriority & "!"
                                                  set priorityEntered to true
                                        else
                                                  if currentItem is " " and priorityEntered then
                                                            set isPriority to false
                                                            set hasBeenPriority to true
                                                  end if
                                        end if
                              end if
                              if isTime then
                                        if currentItem is " " then
                                                  if timeEntered then
                                                            set isTime to false
                                                            set hasBeenTime to true
                                                  end if
                                        else
                                                  if currentItem is not "-" then set reminderTime to reminderTime & currentItem
                                                  set timeEntered to true
                                        end if
                              end if
                              if isDate then
                                        if currentItem is " " then
                                                  if dateEntered then
                                                            set isDate to false
                                                            set hasBeenDate to true
                                                  end if
                                        else
                                                  if currentItem is not "-" then set reminderDate to reminderDate & currentItem
                                                  set dateEntered to true
                                        end if
                              end if
                              if isList then
                                        if currentItem is " " then
                                                  if listEntered then
                                                            set isList to false
                                                            set hasBeenList to true
                                                  end if
                                        else
                                                  if currentItem is not "-" then set reminderList to reminderList & currentItem
                                                  set listEntered to true
                                        end if
                              end if
                              if isNotes then set reminderNotes to reminderNotes & currentItem
                    end repeat
                    if reminderDate is not "" then
                              if reminderTime is "" then set reminderTime to time string of (current date)
                    end if
                    if reminderTime is not "" and reminderTime does not contain "am" and reminderTime does not contain "pm" then
                              try
                                        if (item 1 of the characters of reminderTime) as number is greater than or equal to 8 and (item 1 of the characters of reminderTime) as number is less than or equal to 11 then
                                                  set reminderTime to reminderTime & "am"
                                        else
                                                  set reminderTime to reminderTime & "pm"
                                        end if
                              end try
                    end if
                    try
                              set reminderDateAndTime to date (date string of (date (reminderDate & "/" & last word of (date string of (current date)))) & " " & time string of (date reminderTime))
                    on error
                              set reminderDateAndTime to false
                    end try
  createReminder(reminderName, reminderPriority, reminderNotes, reminderList, reminderDateAndTime)
                    tell application "Quicksilver" to show notification "The reminder was created successfully" text "Quicksilver successfully created your reminder."
          end process text
          on createReminder(theName, thePriority, theNotes, theList, theDate)
                    if thePriority is 1 then set thePriority to 9
                    if thePriority is "!" then set thePriority to 9
                    if thePriority is 2 then set thePriority to 5
                    if thePriority is "!!" then set thePriority to 5
                    if thePriority is 3 then set thePriority to 1
                    if thePriority is "!!!" then set thePriority to 1
                    tell application "System Events"
                              if exists process "Reminders" then
                                        set wasOpen to true
                              else
                                        set wasOpen to false
                              end if
                    end tell
                    tell application "Reminders"
                              if theDate is false then
                                        try
  make new reminder at list theList with properties {name:theName, body:theNotes, priority:thePriority}
                                        on error
  make new reminder with properties {name:theName, body:theNotes, priority:thePriority}
                                        end try
                              else
                                        try
  make new reminder at list theList with properties {name:theName, body:theNotes, remind me date:theDate, priority:thePriority}
                                        on error
  make new reminder with properties {name:theName, body:theNotes, remind me date:theDate, priority:thePriority}
                                        end try
                              end if
                              if wasOpen then
  show reminder theName
                              else
                                        quit
                              end if
                    end tell
          end createReminder
end using terms from

This seems to find the ID, which is sort of the answer to my question, but I still don't seem to be able to use it to show to right reminder. I get this error:
error "Reminders got an error: Can’t make reminder id \"1E436B16-561C-4F88-8CA6-78029BE68BBF\" into type integer." number -1700 from reminder id "1E436B16-561C-4F88-8CA6-78029BE68BBF" to integer
What is wrong, and how should I fix it?
Here is the createReminder block now:
on createReminder(theName, thePriority, theNotes, theList, theDate)
          if thePriority is 1 then set thePriority to 9
          if thePriority is "!" then set thePriority to 9
          if thePriority is 2 then set thePriority to 5
          if thePriority is "!!" then set thePriority to 5
          if thePriority is 3 then set thePriority to 1
          if thePriority is "!!!" then set thePriority to 1
          tell application "System Events"
                    if exists process "Reminders" then
                              set wasOpen to true
                    else
                              set wasOpen to false
                    end if
          end tell
          tell application "Reminders"
                    if theDate is false then
                              try
                                        set theReminder to make new reminder at list theList with properties {name:theName, body:theNotes, priority:thePriority}
                              on error
                                        set theReminder to make new reminder with properties {name:theName, body:theNotes, priority:thePriority}
                              end try
                    else
                              try
                                        set theReminder to make new reminder at list theList with properties {name:theName, body:theNotes, remind me date:theDate, priority:thePriority}
                              on error
                                        set theReminder to make new reminder with properties {name:theName, body:theNotes, remind me date:theDate, priority:thePriority}
                              end try
                    end if
                    set theID to the id of theReminder
                    if wasOpen then
  show theID
                    else
  quit
                    end if
          end tell
end createReminder

Similar Messages

  • How can I find out the iCloud ID which is registered with my iPhone?

    How can I find out the iCloud ID which is registered with my iPhone? I dont know which ID is actually registered with my phone Please help me

    Someone logged into iCloud with his ID maybe my friend or someone but if I get the email info then I can tell him to remove the lock. The ID is started with s*****@hotmail.com. I already asked few of my friends whos name started with s but still didnt find the right one What can I do now?

  • By mistake I have changed the password using iChain but the website still utilises the old password that iChain originally created. How can I find out the original password that was created?

    I created a password using iChain whilst on a website where I have an account. For some reason, I needed to change the password and it seems that the website can only be accessed using the original chain password. I do not have a record of it and it is not in my iChain password list. Can I find what historical passwords were used?

    i am also have the same thing how can i get they out from my game center ?

  • How can I find out the dpi of an image in Acrobat.

    How can I find out the dpi of an image in Acrobat. I have tried the pre-flight option but I really don't understand the pixels width x depth information that I get. I basically just want to know at dpi of a single image. Is there other program that will read my pdf file and tell me this information.

    Thank you, tylerdurdain! That was ridiculously difficult to find. Not sure what version of Acrobat you're using in your image, but for those using Acrobat Pro 11 (in Mavericks), it's buried under View > Tools > Print Production.
    That opens a panel on the right.
    To keep from having to chase it down this way each time, right click on "Output Preview" and choose "Add to Quick Tools Toolbar". That adds a button to the top right of the toolbar.
    Now you can call up the inspector with one click. Choose Object Inspector as tylerdurdain shows above, then click on the item displayed to get its properties.

  • How can I find out the overall time and not only the time of a single clip?

    I have set up two cameras in one room. Both cameras record the same thing from different perspectives at the same time. I have found an interesting scene for video 1 (recorded by camera 1). Now I would like to find the time at which the interesting scene takes place in video 2.
    However, I have not seen any way to get displayed, at what time the scene starts in relation to the total length of the video (e.g: scene starts after 5 minutes from total 10 minutes).
    The indicated time refers only to a part of the clip and not to the overall project, even if a special clip is not selected. Does anyone know, how I can find out the time?

    Go to Settings>iCloud>Storage & Backup.  It will be shown just below the Back Up Now button at the bottom.

  • How can you find out if another VI running on the same computer and how can you find out the name of that VI?

    Suppose that several VIs running simultaneously on the same computer. How can I find out the names of the running VIs, from another VI?
    If the already running VIs are clones of the same basic VI, open and run with the option "Prepare to call and forget", how can I find out the names and index of each clone? 

    I had an application where I spawned (= ran with Start Asynchronous Call) multiple (reentrant) copies of VIs, and would occasionally "lose control" of them.  I needed a way to find all VIs that were running "Top Level" and stop them (so I didn't have to log off from Windows).
    I used the Application Property "All VIs in Memory" to get an array of (wait for it ...) All VIs in Memory.  I took each name, opened a VI reference to it (simply wire the name string in, as the VI is, by definition, "in memory"), looked at its VI Execution State, and if it was Run Top Level, Invoked the FP.Close and Abort VI Methods.  [To prevent the VI that did all this from "committing Suicide", I compared the name string with the current Call Chain, and did nothing if there was a match].
    I think you could adopt this idea to do what you need.
    BS

  • How can I find out the mail server from email address?

    Hi:
    How can I find out the mail server from email address?
    for example: If I know the email address is [email protected],
    how to find the pop3 and smtp mail server?
    THANK YOU

    You can't tell by the email address since you can pretty much put whatever you want in there (especially if the SMTP server is not filtering anything).
    The header may be able to tell you something. There is a Received header value which looks like it has the routing information although I am not sure if this is a complete trace or just the last hop the message took.
    Sean

  • How can I find out the screen size of the users moniter using the Acrobat SDK?

    How can I find out the screen size of the users moniter using the Acrobat SDK? I need to know how much sreen real estate that is available on the users moniter. Is there some call that I can make from the SDK to discover the maximun X and Y coordinates?
    Thanks,
    Gregory

    Currently, I am testing on multiple moniters and it is defaulting to the moniter designated as the #1 moniter. For our purposes, this is acceptable. Once the two documents have loaded, the user can move and re-size at will.
    Gregory

  • How can i find out the more than one times occurance of integer in a array?

    How can i find out the more than one occurance of integer in a array. Assume i have 2,2,3,4,2,5,4,5 in a Array and i need to find out the how many times of 2, 5 and 4 is exists in that array. Please some one help me as sson as possible. thanks in advance....

    Kumar_Mohan wrote:
    How can i find out the more than one occurance of integer in a array. Assume i have 2,2,3,4,2,5,4,5 in a Array and i need to find out the how many times of 2, 5 and 4 is exists in that array. Sort the array. Then loop through it and compare each i-th element with the (i+1)-th element.
    Please some one help me as sson as possible. thanks in advance....In future postings, please refrain from telling that it is urgent, or you need help ASAP. It is rather rude to do so.

  • How can I find out the apn number of the battery without having it?

    I dont have the battery of my iphone 5 anymore but how can i find out the apn number of the battery? I would like to change it but i need to know the apn number to choose the right battery.

    Apple does not provide any user-serviceable parts (other than accessories or sometimes a SIM card tray).
    Therefore, there are no legitimate iPhone batteries available for sale anywhere.
    Anything you find will either be salvaged, counterfeit, or stolen.

  • How can I find out the number of lines in a text file?

    How can I find out the number of lines in a text file?

    java.io.BufferedReader in = new java.io.BufferedReader( new java.io.FileReader( "YourFile.txt" ) );
    int lineCount = 0;
    while( in.readLine() != null )
    lineCount ++;
    System.out.println( "Line Count = " + lineCount );

  • How can i find out the file size of a Keynote on an iPad please?

    How can i find out the file size of a Keynote on an iPad please?

    I think a rule of thumb is what you're looking for.
    Full bandwidth CD audio (AIFF): about 10 MB/min
    Apple Lossless: about 5 MB/min
    MP3 @ 256k: about 2 MB/min
    MP3 @ 128k: about 1 MB/min
    Of course the MP3 file size is exactly linear with bit rate.
    As for sound quality:
    Apple Lossless is, as the name says, lossless.
    MP3 @128k: fine for listening in the car or the kitchen etc. If you have an audiophile sound system, this will remind you why you spent all that money.
    MP3 @256K: barely distinguishable from CD on very good equipment.
    MP3 @320K: probably not distinguishable from CD.
    I presume that since you're talking about importing classical CDs these are ones you own. Remember you can always do it again if you need higher fidelity or if better technology comes out. I import most CDs at 128k, since most of my MP3 listening is in the car, or walking, or as background. And I can always play the CD if I want to sit and listen.
    The logic for purchased music is totally different -- you probably won't get to upgrade that without buying it some different way. So buying 128k MP3s (or AACs) is something you'll probably regret later. Buying 256k MP3s is a lot less problematic.

  • How can I find out the date of a movie I am trying to pre-order if the date is not available/showing in the "manage pre-order" section?

    How can I find out the date of a movie I am trying to pre-order if the date is not available/showing in the "manage pre-order" section?

    Thanks so much for your reply King_Penguin. No, sadly there is not indication of the expected release date on the film, it's no where to be found. I have also tried to look in other places online, but no luck. I guess your latter statement jives more with my situation, that  being the studio/rights-holder hasn't feel inclined to provide the date.

  • How do I find out the exact path of each and every file that LabVIEW finds and loads into memory for a given top level vi?

    How do I find out the exact path of each and every file that LabVIEW finds and loads into memory for a given top level vi? There is probably a trivial, easy way to get this info, but I have not yet found it!  Thanks..

    Or if you want to grab all the paths programatically, try the attached VI.
    Open the top level that you want all the paths from and close all others, then open the
    attached and run it. It will return an array of all the VIs that the VI
    in question uses, including vi.lib VIs. You can filter these as well if
    you like.
    Ed
    Message Edited by Ed Dickens on 08-01-2005 07:01 PM
    Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
    Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
    Attachments:
    Get all paths.vi ‏29 KB

  • How do i find out the tables (data)effected in a schema after a particular time stamp

    how do i find out the tables (data not structure)effected in a schema after a particular time stamp?
    pls email in [email protected]

    You can't do that. That would be a real security risc.
    /KAj

Maybe you are looking for