Re: linking document file attributes into a FileMaker Pro record
Re: linking document file attributes into a FileMaker Pro record
- Subject: Re: linking document file attributes into a FileMaker Pro record
- From: bryan <email@hidden>
- Date: Mon, 29 Jul 2002 21:00:27 -0400
what you want to do is to create the entire record at once with the cells
filled from a data record. This will give you a speed increase equivalent
to the multiple of the number of cells you are filling. (i.e. 10 cells = 10x)
property record_out : {docFilename:"", docCreatedate:"", ....}
--note: the order of the items in this record MUST be the same
--as the creation order of the fields of the DB. You do not have
--to match the field names, just the sequence. You also do not
--have to fill every field in the DB, just every one up to the last
--one you need to put info into at the time of creation. (i.e. if you have
-- 20 fields in the DB but the last cell you need to fill is number 10 in
-- creation order, then you only need 10 items in the record.
copy record_out to thisrec
--this is necessary to prevent bleed-over of the data from
--the previous record
tell application "Finder"
set docFilename of thisrec to (name of docRef)
set docCreatedate to creation date of docRef
set docCreatedate of thisrec to the clock from <wrap>
(docCreatedate) using form "%d/%m/%c%y"
... etc
end tell
--you can fill in the values in any order and since they are declared
--in the original property statement as "", you don't have to define
--every item in the record; just the ones you want defined at the
--time of creation.
tell application "FileMaker Pro"
set newRec to create new record with data (thisrec as list) <wrap>
at end of layout 0 of database myDBname
end tell
--layout 0 is the field creation order layout, if you use another layout
--just match the sequence of 'record_out' to the layout used.
--You can even tell FileMaker to hide the DB and use this a
--background event without activating Filemaker. This is what I
--would recommend for speed.
You can load thousands of records very rapidly this way.
HTH.
Bryan Kaufman
"John, Mitchell" wrote:
>
Dear scripters
>
>
I wrote some time back (Jan 2001!) on this project (you fixed me up
>
then...:-)
>
>
I am forming a FileMaker Pro database of documents making a link
>
(pathname, size etc) to the file.
>
>
I use LNS choose file osax (are there any alternatives?) to select the
>
file and then create a record in FMPro and copy the file path and
>
selected properties.
>
>
This is very slow (G4 Ti laptop, 9.2.2, 512 Mb RAM, AS 1.6, FMPro has
>
memory allocation of s10, m 30, p 50 MB);
>
>
There are two contradictory responses.
>
>
A single file selection is quite fast and once the document is selected
>
in the LNS dialog it almost instantaneously creates the FMPro record.
>
>
When I try to link say a nested folder of documents, is use Finder to
>
get the list:
>
>
tell application "Finder
>
set fileCount to (count of files in folder folderRef)
>
set folderCount to (count of folders in folder folderRef)
>
>
if folderCount > 0 then
>
set folderLocList to (every folder in folder folderRef)
>
end if
>
>
repeat with thisFolder in folderLocList
>
-- get files in each folder
>
set fileCount to (count of files in thisFolder)
>
if fileCount is greater than 0 then
>
set fileList to (every file in thisFolder)
>
-- register files in sub directory
>
my registerFiles(fileList)
>
end if
>
end repeat
>
end tell
>
>
and then registerFiles(fileList) does the following for each file in the
>
list...
>
>
tell application "Finder"
>
set docFilename to (name of docRef)
>
set docCreatedate to creation date of docRef
>
set docCreatedate to the clock from (docCreatedate) using form
>
"%d/%m/%c%y"
>
... etc
>
end tell
>
>
and to create the record...
>
>
tell application "FileMaker Pro"
>
make new record ...
>
set cell "Doc_file_name" of currentRec to docFilename
>
set cell "Doc_title" of currentRec to docFilename
>
...
>
end tell
>
>
I need a jug of coffee to stay awake. I have removed a lot of error and
>
option checking here but I presume this should not really add much to it
>
>
your commentary much appreciated
>
TIA
>
>
John
>
PS of course I can provide the whole script if needed
>
--
>
>
------------------------------------------------------------------------
>
--------------------------------------------------------------------
>
John Mitchell
>
Director, Virtual Building Technologies, Graphisoft R&D Rt
>
Zahony utca 7, Budapest 1031, Hungary
>
Email: email@hidden
>
Tel: +36 (1) 437 3263 * Fax: +36 (1) 437 3099 Mob: +36 20 978 6077
>
>
------------------------------------------------------------------------
>
--------------------------------------------------------------------
>
CONFIDENTIALITY NOTE: This message is for the named person's use only.
>
It may contain confidential
>
or legally privileged information belonging to Graphisoft R&D Rt. and/or
>
its subsidiaries. No confidentiality
>
or privilege is waived or lost by any error in transmission. If you
>
receive this message in error, please
>
immediately delete it and notify the sender. You must not, directly or
>
indirectly, use, disclose, distribute,
>
print, or copy any part of this message if you are not the intended
>
recipient.
>
_______________________________________________
>
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.
[demime 0.98b removed an attachment of type text/x-vcard which had a name of bryan.vcf]
_______________________________________________
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.