Mark DeNyse Posted September 22, 2004 Posted September 22, 2004 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?
Kurt Knippel Posted September 22, 2004 Posted September 22, 2004 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".
Mark DeNyse Posted September 22, 2004 Author Posted September 22, 2004 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?
Fenton Posted September 23, 2004 Posted September 23, 2004 Oddly enough, the pseudo-code is not only AppleScript code, it works fine on my machine. So what's up with that :-?
Kurt Knippel Posted September 23, 2004 Posted September 23, 2004 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.
bruceR Posted September 24, 2004 Posted September 24, 2004 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
Recommended Posts
This topic is 7735 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now