How do I use Display Dialog to get back a date?

Can anyone tell me how to use Display Dialog to get back a date?
I am using the following code that does not work. It does not accept anything.  And I have searched high and low for an answer to my question and found nothing.
repeat
       display dialog "When should I remind you (date)?" default answer ""
       try
             if the text returned of the result is not "" then
                    set the requested_text to the date returned of the result as date
                    exit repeat
            end if
       on error
           beep
end try
endrepeat
display dialog requested_text
The code is based on what I found in AppleScript 1-2-3 (page 300). It shows examples for getting text and numbers but not one for dates.
For what it is worth, my goal is to create a script that will convert an email from Evernote into an iCal Reminder. To do so, I want to ask the user (myself) for the reminder's date and time. I am assuming I need to ask for each separately. I also assume that once I get the date and time for the reminder, it should be relatively straightforward to 'make' a 'todo' with an alarm.
Thanks in advance.
-David

Hi David,
Try this:
repeat
    set theCurrentDate to current date
    display dialog "When should I remind you (date)?" default answer (date string of theCurrentDate & space & time string of theCurrentDate)
    set theText to text returned of result
    try
        if theText is not "" then
            set theDate to date theText -- a date object
            exit repeat
        end if
    on error
        beep
    end try
end repeat
display dialog (date string of theDate & space & time string of theDate)
You might also have a look at this page of the AppleScript Language Guide.
Message was edited by: Pierre L.

Similar Messages

  • How to delete "temporary" a game and get back the data later?

    Hello everybody
    My iphone4s 16GB is quite full .
    I wish to delete some game (Galaxy on Fire for example) to have some free space. But i don't want to loose all what i gained during the 45h of play I spent in this game... I want to be able to re-install this game later and find my last save.
    Can you tell me how to proceed?
    Thnaks in advance for your help!
    Guillaume

    You can't do that easily.
    Find another way to free up space, because even if you were able to strip the save data for this game from your device (just do a google search to see how complicated that is) there isn't any guarantee that would even work if you put it back on.

  • I upgraded my imac hard drive to a 2tb drive. how do i use time machine to get my computer back to normal?

    i upgraded my imac hard drive to a 2tb drive. how do i use time machine to get my computer back to normal?

    Thank you. I followed the faq#14 (using setup wizard from the osx install disk). Everything went just as planned until I woke up this morning and noticed there was no progress on the "transferring documents" meter. It stopped about 1/4 of the way. I can hear the computer working and the bar is somewhat animated like it is advancing but it's not.
    Should I cancel and restart or should I wait it out? It already been about 13 hours since I started the process. Do you think it is my time machine or my iMac? Maybe the time machine file is corrupt or something.
    Anyway, any help is appreciated. Thanks.

  • How do I use Migration Assistant to get my Mail and Keychain settings from

    How do I use Migration Assistant to get my Mail and Keychain settings from my Power Mac G5 2.3Ghz? I just purchased a new 2.5 MacBook Pro which will be delivered tomorrow, and I want to to know how to transfer Mail and Keychain?
    Thank You in advance for your reading and replying.
    Kindest Regards,
    Sebastian

    Rather than using Migration Assistant, which can cause trouble with the PPC to Intel change, simply boot the G5 in FireWire target disk mode and manually transfer the following:
    /Home/Library/Keychains (copy the whole folder)
    /Home/Library/Mail (copy the whole folder)
    /Home/Library/Preferences/com.apple.mail.plist
    You might want to look over Kappy's helpful guide for migrating, which covers the full process for a manual migration (including the above files).
    Hope this helps...

  • How can I use QuickTime SDK to get Compress format of Video stream?

    I can get uncompress video stream like this:
    QDerr = NewGWorldFromPtr( &m_hGWorld, k32BGRAPixelFormat, &rcMac,
    NULL, NULL, 0, (char*)m_pVideoBuffer,
    m_sAVFileInfo.sResInfo.ulWidth*4);
    then the m_pVideoBuffer is uncompress video stream. How can I use QuickTime SDK to get Compress format of Video stream? I could change "k32BGRAPixelFormat" to other format,use other API or something?
    Could someone have the method? Best Wishes!

    Firefox, I would make sure you update your Desktop to Firefox 14.0.1, as the version you are running is quite old and out of date.
    Then, do you have your Sync Recovery key, username and password? If you do, you can re-add Firefox Sync to your computer.

  • How can i get back my data after i restored my iphone and accidentally created a new iphone ac.

    how can i get back my data after i restored my iphone and accidentally created a new iphone ac.
    it did a back up when i started my restored iphone and i cant retrieve my previous backup while i didnt back up on icloud....
    the new ac is actually the same apple id as the one i used. I lost all my contact, photos and data of whatsapp...
    what can i do...help!

    I don't know if this is a similar problem but I wrote 2 notes yesterday on my iphone. I opened my mail to print them and they appeared as notes but wouldn't load. Then I looked at them on my iphone and I could see the notes but they quickly updated to blank with a time of the last edit the same time I tried opening them on my computer.
    Yesterday I updated to 4.3.4  I don't know if somehow that affected them. Are they stored somewhere else. Can I get them back?

  • Firefox 5 has lost all my chrome tab's and capabilities which came with 4? how do I un install 5 and get back to my version 4?

    firefox 5 has lost all my chrome tab's and capabilities which came with FF4? how do I un install 5 and get back to my version 4 & retain all my bookmarks at least I's also like to retrieve my Chrome capabilities as well?

    Firefox 4 requires at least OS X 10.5 and an Intel Mac. There is a third party version of Firefox 4 that runs on OS X 10.4/10.5 and PPC Macs, for details see http://www.floodgap.com/software/tenfourfox
    If you prefer, you can get the latest version of Firefox 3.6 from http://www.mozilla.com/en-US/firefox/all-older.html
    Mozilla are working to prevent Mac users with non-compatible systems from getting the notification about Firefox 4, and also not displaying the "Download Firefox 4" button on http://www.mozilla.com

  • Have updated firefox and my e-mail at terra.es has disappeared .with no mail shown or history.how can i recover my mail or get back to original firefox. am on windows 7.

    have updated firefox and my e-mail at terra.es has disappeared .with no mail shown or history.how can i recover my mail or get back to original firefox. am on windows 7.

    Clear the cache and the cookies from sites that cause problems.
    * "Clear the Cache": Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"
    * "Remove the Cookies" from sites causing problems: Tools > Options > Privacy > Cookies: "Show Cookies"
    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    * Don't make any changes on the Safe mode start window.
    * https://support.mozilla.com/kb/Safe+Mode
    * [[Troubleshooting extensions and themes]]

  • How to get backed up data in iphone3gs when the phone is disabled

    how to get backed up data in iphone3gs when the phone is disabled

    can someone help? this is shaking my trust in icloud backups.
    i am on iOS 6.1.

  • When I'm bouncing a project, it freezes or doesnt stop bouncing and keeps going past its cut off. how do i make it stop and get back to normal?

    When I'm bouncing a project, it freezes or doesnt stop bouncing and keeps going past its cut off. how do i make it stop and get back to normal?

    Hi
    chorleyman wrote:
    you do have to actually define the area to be bounced in the dialogue window that comes up - there are some discrepencies in the way that the program behaves like that,
    Apart from the "Include Audio Tail" function, which can leave Logic bouncing for a very, very long time, there are generally, no discrepancies regarding the Bounce Locators:
    If Cycle is enabled, the bounce locators will be set to the cycle locators.
    If Cycle is off, and regions are selected, the bounce locators will be set to the selection.
    If cycle is off, and no regions are selected, the bounce locators will be set from the Project Start to the project end.
    It is smart to actually check that the bounce locators are set where you would like them to be.
    wildfire31 wrote:
    When I'm bouncing a project, it freezes or doesnt stop bouncing and keeps going past its cut off. how do i make it stop
    If you get caught with a bounce that does not stop, Command . (period) should do the trick.
    CCT

  • I have installed the latest OS Lion and now a number of applications do not work.  How and where do I go to get back to Snow Leopard 10.6.8

    I have installed the latest OS Lion and now a number of applications do not work.  How and where do I go to get back to Snow Leopard 10.6.8

    Restore from the backups you made before upgrading.

  • HT5137 my app is stuck on one page of the ibook I was reading. How do I close my ibook and get back to the main library?

    My app is stuck on one page of the ibook I was reading. How do I close the ibook and get back to the main library?

    A number of extensions can cause that problem, you'll need to do a little troubleshooting to find out which extension is causing that to happen for you.
    [http://support.mozilla.com/en-US/kb/troubleshooting+extensions+and+themes]

  • My ibook is frozen on one page. How do I close the ibook and get back to the main library?

    My ibook is frozen on one page. How do I close the ibook and get back to the main library?

    This is the iPod touch forum. You seem to have an iBook problem and can't understnd your problem with that.
    I do not understand what you mean by page and what you mean by library.

  • How i cen get back deleted data from the bin?

    how i cen get back deleted data from the bin?

    Not once you have put the data in the trash and pressed the button to delete it.
    There may be some hope if you can understand what I am telling you in my first post to you.
    Time machine is too complex to explain in this kind of post but I am giving you five links below which should explain quite a lot.   There are no formal instruction manuals for Time Machine.
    Time Machine Tutorial
    Time Machine 101
    How to back up and restore your files           This in particular
    Time Machine Features
    Apple - Support - Mac OSX v10.5 Leopard Time Machine

  • Is there any way to get back my data if I had not restored it from time machine before reinstalling Mac OS X on my comp from utility. PS - My OS version has downgraded from Mountain Lion to Mac OS X 10.75  . Pls. help

    Is there any way to get back my data if I had not restored it from time machine before reinstalling Mac OS X on my comp from utility. PS - My OS version has downgraded from Mountain Lion to Mac OS X 10.75  . Pls. help

    Look at the blue box on this link:
    http://pondini.org/TM/19.html
    Ciao.

Maybe you are looking for