move file script

I am working on a script that takes a field in FMP and finds the file of the same name in the field then moves it to the folder I have set. The problem is I get this error "Can’t get file “DEL525045A” of folder “Test Files” of disk “Apps”
What am I doing wrong?

tell application "FileMaker Pro"
   show every record in database "Test Gang"
   sort database "Test Gang" by field "Form Num" in order ascending
   sort database "Test Gang" by field "version Info" in order ascending
   set myInfo2 to ""
   set myInfo2 to myInfo2 & cell "version info" of record 1 of database "test Gang" 
end tell
tell application "Finder"
   activate
   set x to myInfo2
   select file x of folder "Test Files" of disk "Apps"
   move selection to folder "0219000" of folder "To JTS" of disk "Apps" 
end tell

I haven’t scripted FileMaker much, but you might try
contents of cell “version info” of record 1 of database “test Gang” as text
or something to that effect… FileMaker may want you to be slightly more specific than referring to the cell object.
Can anyone else provide insight? Am I way off here? :

: I am working on a script that takes a field in FMP and finds the
: file of the same name in the field then moves it to the folder
: I have set. The problem is I get this error "Can’t get
: file “DEL525045A” of folder “Test Files”
: of disk “Apps”
: What am I doing wrong?
: tell application “FileMaker Pro”
: show every record in database “Test Gang”
: sort database “Test Gang” by field “Form Num”
: in order ascending
: sort database “Test Gang” by field “version
: Info” in order ascending
: set myInfo2 to “”
: set myInfo2 to myInfo2 & cell “version info” of
: record 1 of database “test Gang” end tell
: tell application “Finder”
: activate
: set x to myInfo2
: select file x of folder “Test Files” of disk
: “Apps”
: move selection to folder “0219000” of folder “To
: JTS” of disk “Apps” end tell
Since you’re using “select” and “selection” I assume that you recorded some of the script. That is truly one of the best ways to learn to script but it often breaks down in later uses.
Your whole script can really boil down to six lines; you might want to leave the sorting in but I’m not quite sure what you were doing with it:

tell application "FileMaker Pro"
   set myInfo2 to cell "version info" of record 1 of database "test Gang"
end tell
tell application "Finder"
   move (file myInfo2 of folder "Test Files" of disk "Apps") to folder "0219000" of folder "To JTS" of disk "Apps"
end tell

There’s no need to set myInfo2 to “” if you are then immediately setting it to cell data, and there’s then no reason to rename it to x when you enter the Finder tell block.
Hope this helps!
Bill

: I am working on a script that takes a field in FMP and finds the
: file of the same name in the field then moves it to the folder
: I have set. The problem is I get this error "Can’t get
: file “DEL525045A” of folder “Test Files”
: of disk “Apps”

: What am I doing wrong?

I’m wondering if FMP has added some extraneous invisible characters to the file’s name. You might take a count of the variable containing it and see.
Marc K. Myers
Marc@AppleScriptsToGo.com
AppleScriptsToGo
4020 W.220th St.
Fairview Park, OH 44126
(440) 331-1074

[02/13/2002 7:27:15 PM]

I found out my problem. FMP has multiple fields like Marc mentioned.
Now how do I set this information I selected in FMP to only 8 characters? If you haven’t guessed I’m a newbie to Applescript.