This post will deal with what I consider a very concrete use of the ‘choose from list’ dialog. After reading this (and perhaps trying it out in the Script Editor) you will probably be totally confused (just kidding!!) It gets a little complicated, but it is basically a cut-and-paste script.
If you pay close attention to my comments, I’m sure you’ll understand most of what is going on and, after all, it’s understanding how a script works that allows you adapt it to other applications that you may have in mind.
So anyway, here it is:
set AppleScript's text item delimiters to ","
–this first line is needed, because it sets things up for extracting the info we need
set theLongDate to (current date)
set theLongDate to (date string of theLongDate)
–the next 2 lines set us up for calculating the numerical data for month and day
set currentMonth to (word 1 of text item 2 of theLongDate)
set currentDay to (word 2 of text item 2 of theLongDate)
–this gets the numerical value for the month
set currentYear to (word 1 of text item 3 of theLongDate)
set monthList to {January, February, March, April, May, June, July, August, September, October, November, December}
repeat with x from 1 to 12
if currentMonth = ((item x of monthList) as string) then
set theRequestNumber to (text -2 thru -1 of ("0" & x))
exit repeat
end if
end repeat
set currentMonth to theRequestNumber
set currentDay to (text -2 thru -1 of ("0" & currentDay))
set theShortDate to (currentMonth & "/" & currentDay & "/" & currentYear) as string
–previous code sets up the default text (current date in the form mm/dd/yyyy – something like ’02/03/2009′) for dialog below :
set theDefaultDate to text returned of (display dialog "Enter a date in the form MM/DD/YYYY:" default answer theShortDate buttons {"Calc Date"} default button {"Calc Date"} giving up after 20)
–this line converts the text supplied by the dialog into class ‘date’ (the long form of the date, including the time):
set calcLongDate to date theDefaultDate
–this line extracts the date portion and leaves the time portion behind:
set calcLongDateTrunc to (date string of calcLongDate)
–this converts calcLongDateTrunc back into the form ‘text’ so that it can be displayed in a dialog:
set calcLongDateTrunc to calcLongDateTrunc as string
display dialog calcLongDateTrunc buttons {"Done"} default button {"Done"} giving up after 15
–yields – ‘Tuesday, February 3, 2009′
In my next post, I will shift gears and present an AppleScript which I have derived from one of my FileMaker programs, which serves as a convenient file backup program.
In conclusion, please note in my right sidebar (you may have to scroll), that in the future I will be featuring (here and there) little snippets of HyperTalk code (and others as they occur to me)
As always, if you have any questions or comments, contact me at: hyperscripter@gmail.com or http://twitter.com/hyperscripter or to subscribe, click the By Email link at the top of the page


















It a great idea! Just wanna say thank you for the information you could have posted. Just continue publishing this sort of post. I am about to a loyal reader, thanks a lot.
Just killing some in between class time on Digg and I discovered your article . Not usually what I desire to examine, but it was completely value my time. Thanks.
I bought some nice info here. I think that in case a greater number of people thought of it like this, they’d possess a better time get the hang ofing the matter.
We simply shared your website and wished to say that I have really enjoyed reading your blog posts. By any means I’ll be subscribing to your feed rss now, thanks
I really like what you guys tend to be up too. This sort of clever work and coverage! Keep up the superb works guys I’ve incorporated you guys to blogroll.
I need to exhibit my passion for one’s understanding giving assist to firmly personnel that need relief on that region of curiosity. Your personal enthusiasm to actually receiving the note all-around came into existence incredibly invaluable but has in every issue enabled women somewhat like me to arrive over at their likes and dislikes. Your unique humid and friendly guidance indicates tons with me and pretty well additional upto my consorts. Best wishes; from each one of us.
It a wonderful idea! Just wanna say thank you of the news you have diffused. Just continue composing one of these post. I am going to a loyal reader, thanks a lot.
Thanks, You probably haven’t that will do this, however I believe you have got could express the mind-set that many of people are in.
Just killing some in between class time on Digg and I found your article . Not usually what I want to read about, however it was absolutely worth my time. Thanks.
I just could not go away your site prior to suggesting that I extremely enjoyed the usual information a person supply for your guests? Is gonna be back continuously to inspect new posts
It a big idea! Just wanna say thank you for news you could have posted. Just continue composing this sort of post. I’m going to a loyal reader, thanks a lot.
I like the helpful info you provide in your articles.
I’ll bookmark your weblog and check again here frequently. I am quite certain I’ll learn a lot of new stuff right here! Good luck for the next!
Best Regards Nick
I had been very happy to locate this internet site.I really wanted to thank you for this cool read!! I definitely enjoying every part of it but i have you ever bookmarked to find new stuff from you post.
The sense of intending to assist, however not finding out how or the place, are some things a range of us have gone through.
I have learned newer and more effective things from a blog post. Also a thing to I have recognized is that usually, FSBO sellers will reject an individual. Remember, they will prefer to not ever use your products and services. But if you maintain a reliable, professional romance, offering guide and keeping contact for around four to five weeks, you will usually be able to win a business interview. From there, a listing follows. Cheers
Thank you for any other magnificent post. Where else may just anyone get that kind of information in such an ideal way of writing? I’ve a presentation subsequent week, and I’m at the search for such info.
I conceive you might have noted some really fascinating details , regards for the post.
Definitely, what splendid weblog and instructive posts, I surely can bookmark one’s internet site.Every one of the Best!
Definitely, such a splendid web site and instructive content, I definitely may bookmark one’s web page.All of the Best!
Definitely, such a tremendous site and instructive content, I definitely will bookmark your particular website or blog.All of the Best!