Re: Now-Up-To-Date Event Creation from FileMaker 7
Re: Now-Up-To-Date Event Creation from FileMaker 7
- Subject: Re: Now-Up-To-Date Event Creation from FileMaker 7
- From: "Gary (Lists)" <email@hidden>
- Date: Mon, 15 Aug 2005 10:14:02 -0400
"Dana Haynes" wrote:
> Hi all.
>
> The following script will not place the event on the proper date of
> the calendar unless I specify the date as a literal string in the
> script.
>
> Now-Up-To-Date uses the default date of "Today" if it does not know
> what date to put the event on. I have tried coercing the variable
> "FMMileStoneStartDate", I have tried making it global. I have tried
> bringing everything into on large tell block.
>
> What am I missing?
Dana, this does seem perplexing. I did a few tests and the returned result
from a FM date field is a string. This is true for FM date fields of type
'Date' as well as of type 'Number' or 'Text'.
But, there are some possible places to look more closely, so...
Since your script does not seem to target any particular record of the
database, the script will simply taking the data from the first record of
the current found set every time. (Maybe that record has an empty date?)
You can either wrap your statements inside a "tell current record" block:
tell app "FileMaker Pro"
show window ...
go to layout ...
...
tell current record
set ...
set ...
set ...
end tell
...
...
end tell
or you can add "...of current record" to the end of each of those 'set'
statements.
Also, and this may not matter, try altering the date line to:
set FMMileStoneStartDate to cell "EventDate" -- not 'data of cell'
You may not really be getting the data (class) that you are actually seeing.
(AppleScript may be providing a coercion unseen.)
> tell application "FileMaker Pro"
> show window "Test Database"
> go to layout "Test Database"
> set FMMileStoneName to "Test Label"
> set FMMileStoneDuration to 1
> set FMMileStoneNote to "This is a note"
> set FMMileStoneStartDate to get data of cell "EventDate"
> end tell
It's possible that using 'data of cell' is constructing a reference and not
giving you data as you'd expect, so that once you're outside the FM block,
that reference is not valid. (In my simple tests, 'get data of' also works
just fine to provide me with a string, but I do not know how your real
fields are defined, so it's not a very useful confirmation.)
It's not all that common in FM applescripting to use 'data of
cell'...although I haven't looked at the dictionary so I don't know the
specific differences that FM might see.
> Warm regards,
Please send some cool regards (if you have any in Tamarac) ... I'm melting.
--
Gary
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden