April 3, 200421 yr Newbies Is there a way to extract the data from a documents "get info" and import into FMP? FileMaker Version: 7 Platform: Mac OS X Jaguar
April 4, 200421 yr If on Mac, type the following into AS Script Editor: set theInfo to info for (choose file) It returns a "record," which is a series of named pieces of date: name, name extension, file type, etc.. Each item can be accessed via its label. Then it's just a question of setting them into corresponding FM fields. The simplest example, in a Perform AppleScript step: set theInfo to info for (choose file) tell current record of document 1
April 4, 200421 yr I also discovered that getting the "kind" from the info kicks up an error when run in a FileMaker Perform AppleScript step; but not in Script Editor. So just put all whole "info for" block inside a tell "Finder" call.* That's probably 'cause "kind" is a command to get the "class" of an object in FileMaker; sometimes command keywords conflict. You've also got the file type, creator and extension; but sometimes those are missing these days, so kind is more reliable, if a little verbose. *The FileMaker commands don't need to be in a tell "FileMaker Pro" block, unless when testing scripts in Script Editor. FileMaker knows who it is. I put them outside, then remove them.
April 4, 200421 yr And, while I'm at it :-), the default application returns an alias, which you have to coerce "to text" or "to Unicode text" to put into FileMaker. The dates are a date|time stamp, so they also benefit from a "to string." I also coerced size, since I divided it by 1024 for K.
Create an account or sign in to comment