Re: Panther and AppleScript property not retained - why?
Re: Panther and AppleScript property not retained - why?
- Subject: Re: Panther and AppleScript property not retained - why?
- From: Hanaan Rosenthal <email@hidden>
- Date: Wed, 10 Dec 2003 11:10:56 -0500
- Organization: Custom Flow Solutions
Tero,
Not sure why it isn't working, but here's a workaround.
Try to store your property as a string instead of as a file reference:
property SMSDatabaseFile : ""
on run
tell application "Finder"
if SMSDatabaseFile is "" or not (exists file SMSDatabaseFile) then
set SMSDatabaseFile to (choose file) as string
end if
tell application "FileMaker Developer" to activate
open file SMSDatabaseFile
end tell
end run
>
>
Hi!
>
>
I have some pre-Panther scripts, which after upgrade to Panther seem
>
to have lost their ability to save/store/retain the property value
>
assigned during the first run after compilation; the scripts have a
>
branch checking whether a property is defined (at least that is the
>
intention) and ask for the user to define the property, if it is
>
initially undefined. The scripts, however, keep on asking for the
>
property each and every run, although the property has been defined
>
on previous run. An example snippet of such a script is below:
>
>
property SMSDatabaseFile : ""
>
>
>
on run
>
set currentDate to the current date
>
set formattedDate to (my format_date_using(currentDate, ".",
>
{"DD", "MM", "YYYY"}))
>
set formattedTime to (my format_time_using(currentDate, ":",
>
{"HH", "MM"}))
>
copy "SMS-arkisto" to theDatabase
>
--copy "SMS-arkisto Clone" to theDatabase
>
copy "Vastaanotettu viesti" to theLayout
>
tell application "Finder"
>
if SMSDatabaseFile is "" or not (exists SMSDatabaseFile) then
>
set SMSDatabaseFile to (choose file)
>
end if
>
tell application "FileMaker Pro" to activate
>
open file SMSDatabaseFile
>
end tell
>
end run
>
>
I have tried saving this script in various formats (including the new
>
.app format), but that seems not to help. Hence, is there something
>
obviously wrong in the definition and handling of the property
>
(SMSDatabaseFile in this case)?
>
>
I'd appreciate responses directly to my personal e-mail also...
>
>
With best regards
>
>
Tero Siili
>
--
>
Finnish Meteorological Institute / GEO
>
P.O. Box 503
>
FIN-00101 Helsinki, Finland
>
Tel. +358 9 19294660 Telefax +358 9 19294603
>
_______________________________________________
>
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.
_______________________________________________
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.