Re: AppleScript-Users Digest, Vol 7, Issue 311
Re: AppleScript-Users Digest, Vol 7, Issue 311
- Subject: Re: AppleScript-Users Digest, Vol 7, Issue 311
- From: Jason Bruce <email@hidden>
- Date: Mon, 14 Jun 2010 13:28:43 -0700 (PDT)
Hi Ed,
Ed Stockly wrote:
"Sure is frustrating using applescript with FM pro. I'm ready to give up on it."
FMP's got one of the oldest and, in my opinion, best applescript dictionaries around. FMP and database events can work fine together, b/c FMP is a scriptable app and database events is an osax. So the data in both can be accessible in your script -- you can also embed an applescript in an FMP script step, which makes the applescript scream. To get your data into FMP, I think what you want to do is to read your raw text in all at once into an applescript list using either Applescript or another text processing tool, and then in a tell app "FileMaker Pro" block iterate through the list to create a new FMP record. Something like the following pseudo code:
set inputList to {. . .} -- this is the result of your text processing to get your raw text into an applescript list. Each item of the list should be 1 record from your input text, and each record should be a list for each field in your FMP database.
repeat with loopvariable in inputList
tell app "FileMaker Pro"
tell document "MyDatabae"
create new record with data loopvariable -- this will populate each field of an FMP record with each item of loopvariable
end tell
end tell
To get you data out of FMP,
set myDatabaselist to {}
tell document "MyDatabase"
set myDatabaselist to records of "MyDatabase" -- this will give you every record in your database in less than 1 second
end
tell
then, once it's out of FMP and into an AppleScript list, you can drive "Database Events"
repeat with loopvariable in myDatabaselist -- each item of loopvariable is 1 FMP record
tell application "Database Events"
* * * *
make new record with contents of loopvariable
end tell
end repeat
I haven't scripted database in a very long time, so this is pseudo code, but the above is the general idea.
Jason
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden