September 22, 200421 yr OK, I'm stumped and obviously missing something. How can I get the index of the current record so I can use it like this (where 'N' would be the index): set x to get cell "A" of record N of layout "A" of window 1 of database "Test" I know I could write: set x to get cell "A" of current record of layout "A" of window 1 of database "Test" but for some odd reasons that's not working in all of the cases in FM 7 (I get object not found). So back to the original question - how do I get it?
September 22, 200421 yr Well, I understand that you are writing in pseudo-code...but you should get the terminology straight...a database contains fields which are stored in tables. A layout and a window are simply GUI items that will have little impact on your actual "code". This is a set field through a relationship or join (terms are synonmous). So you would SetField "FieldOne" to "RelationshipName::FieldTwo". Assuming a couple of things the syntax would be like: SetField [gClientID; ClientsByName::ClientID]. This would set the "gClientID" field with the contents of the "ClientID" field through the relationship defined as "ClientsByName".
September 22, 200421 yr Author Hi Kurt, Honestly I don't know if you're replying to my post since it seems to have no bearing on what I was asking. Regarldess, the 'pseudo-code' you refer to is actually 'real' AppleScript code that compiles and executes just fine... Perhaps you were actually responding to someone else's post?
September 23, 200421 yr Oddly enough, the pseudo-code is not only AppleScript code, it works fine on my machine. So what's up with that :-?
September 23, 200421 yr Hi Kurt, Honestly I don't know if you're replying to my post since it seems to have no bearing on what I was asking. Regarldess, the 'pseudo-code' you refer to is actually 'real' AppleScript code that compiles and executes just fine... Sorry, I was not paying attention to the Forum and just addressing the question as a general one.
September 24, 200421 yr Especially when dealing with FM7 and applescript you need to mention whether you're writing the script externally in applescript's script editor or inside Filemaker. With external editors applescript gets confused about which version of Filemaker you are talking to. What has worked best for me to clear this up is to get the full app path. I do a choose file so I can get the path then write the scripts this way: tell application "Cube 1:Applications:FileMaker Apps:FileMaker Developer 7:FileMaker Developer.app:" -- your syntax worked for me: set x to get cell "DBNames" of record 1 of layout "DBNames" of window 1 of database "DBNames" end tell
Create an account or sign in to comment