Anyway, I am getting an error which looks to be telling me that a date
can't be returned as a string
--Set variable for default to current date plus one day
set TomorrowDate to (month of (current date)) + 60 * 60 * 24 & "/" & (day of (current date)) + 60 * 60 * 24 & "/" & (year of (current date)) + 60 * 60 * 24
--display dialog "Enter event date:" default answer TomorrowDate
--Can't make {86412, "/", 86404, "/", 88407} into type string
Actually what it's telling you is it can't coerce a list of integers and strings into a string.
The integers are the result of adding numbers to a date.
--try these commands
-------------
set TomorrowDate to ((current date) + 1 * days)
display dialog (weekday of TomorrowDate as string) & ", " & ((month of TomorrowDate as integer) as string) & "/" & day of TomorrowDate & "/" & year of TomorrowDate
display dialog date string of TomorrowDate
-----------
Keep in mind that the date string uses the format for dates set on the user's international preferences, so building the date string from it's parts will give you more consistent results across different setups
Ummm...thanks. I was trying to parse the parts so that they would display in a text string.
Yes, that's a good approach. I use it all the time.
I don't know what resource to go to for finding the right commands and syntax to use.
This list is the best resource. Sometime some of the answers can seem a bit snarky, but overall this is the best place to go for AppleScript questions.
The date value is an integer that records the number of seconds from some pre-determined date. When you execute a date command (current date, month, etc) the integer is coerced into a familiar data format.
You'll notice the month value needs to be coerced to an integer to avoid getting the name of the month.
Here's a scripting tip, in Script Editor open the apple even log and then use the log command to reveal information about variables.