October 25, 201015 yr Newbies I have an accounts (income-expenses) table in a separate database. Can I script moving data via a $$variable into that outside table? I see where I can Open File but it seems the script can't go to a layout outside its own database. I could hit the keys again and type the data into that outside table, but I'd love to script it.
October 25, 201015 yr You can call a script in the other file and pass it a parameter, using the Perform Script[] step. Another option is to place tables from the other file on your relationships graph, create layouts for them and work with them directly.
October 25, 201015 yr Author Newbies Edit: Found it ! Get(scriptparameter). Thanks very much. Thank you. =================== I see that I can call a script from the other file. I don't understand how to pass a parameter, but I see the option to enter one in the Perform Script box. Can I first open and fill a variable with the number and use that to Set Field on the other side's table? Or can I pass the field directly to the other layout and Set Field on the other side using data from that field?
October 25, 201015 yr Author Newbies Yes, thanks. I saw that I could, but because this is a rare occurrence, and no other need for that connection, I like passing the parameter and leaving them separate databases.
October 25, 201015 yr Author Newbies Now that I've learned to pass a parameter, I want to pass three : It seems possible, but I can't figure out how to include MiddleValues() function with Get(scriptparameter) function. I have three $$ variables on the 'here' side. FMP seems to let me do this if I surround the three with quotes and place carriage returns in between. Perform Script ["ascript" from file: "otherfile"; Parameter: "$$var1 (carr-return) $$var2 (carr-return) $$var3(carr-return)" If this is right so far, On the 'there' side, how do I parse the three into three separate Set Field statements ( Using MiddleValues() )?
October 25, 201015 yr You only need to use $$variables if you need them AFTER the script has run - otherwise it's better to use $variables that are cleared when the script exits. Also, you do not need to declare variables only to populate the script parameter; you can calculate the script parameter directly. Parameter: "$$var1 (carr-return) $$var2 (carr-return) $$var3(carr-return)" If this is right so far No. There should be no quotes, unless you are sending literal text. You do need concatenation operators in-between the terms, though: $$var1 & ¶ & $$var2 & ¶ & $$var3 To extract the n-th value on the target side, use: GetValue ( Get (ScriptParameter) ; n )
Create an account or sign in to comment