Re: Script keeps crashing Filemaker Pro
Re: Script keeps crashing Filemaker Pro
- Subject: Re: Script keeps crashing Filemaker Pro
- From: Kai Edwards <email@hidden>
- Date: Fri, 22 Nov 2002 05:16:31 +0000
on Thu, 21 Nov 2002 19:35:09 EST, email@hidden wrote:
>
I have an applescript which is nested in a Filemaker Pro script step (as a
>
"perform >applescript" command) which keeps crashing the program. It is
>
intended to check for >>the presence of a particular file and it's creation
>
date. On some macs, it seems to >work fine, but on others (all 9.2.2 by the
>
way) it either crashes or returns the error >"Can't make 'Macintosh HD:' into
>
an item (Error -1700)" (where Macintosh HD is the >name of the startup disk)
>
It's worked fine for years, but now is creating problems on certain
>
computers.
>
Here is the script:
>
>
get path to startup disk
>
set p to result as string
>
>
set l to list folder p
>
set diskName to p as text
>
if l contains "Example File" then
>
set checkFile to diskName & "Desktop DT" as alias
>
set checkFileData to info for checkFile
>
set checkFileDate to creation date of checkFileData as text
>
if l contains "Example File" and checkFileDate is equal to "Sunday,
>
December 24, 1989 12:30:00 PM" then
>
set the clipboard to "Paste This"
>
else
>
set the clipboard to ""
>
end if
>
else
>
set the clipboard to ""
>
end if
Your script _should_ work, Andy. Sounds suspiciously like you might have AS
1.7 installed on the offending machine(s). This version contained rather
more than its fair share of bugs, mainly related to the parsing of file
paths.
If 1.7 is present, then it's worth considering a move either to AS 1.6
(Duncan Cowan has kindly confirmed that your script works there) or to AS
1.8.3.
Since your system choked on a coercion to an alias, it might also be worth
trying the script using only string file paths - something like this:
================================================
set diskName to (path to startup disk) as string
set l to list folder diskName
if l contains "Example File" then
set checkFile to diskName & "Desktop DT"
set checkData to (info for checkFile)'s creation date
if checkData = "Sunday, December 24, 1989 12:30:00 PM" then
set the clipboard to "Paste This"
else
set the clipboard to ""
end if
else
set the clipboard to ""
end if
================================================
However, even if that _does_ work on AS 1.7 (can't test it here), you'd
still be well advised to back away from that version - assuming, of course,
that's where you are. If you're not, then something else is clearly causing
a problem (in which case I'm not helping much)...
HTH.
Kai
--
email@hidden
email@hidden
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.