August 26, 201015 yr Newbies Hello Folks! I came back from DevCon very enthusiastic with my iPad and FileMaker Go. I wrote a custom function that I thought would be a great time saver. It returns if the Ipad or iPhone is in portrait or landscape mode (it can be downloaded from http://www.solucionesfilemaker.com/demos.html) The thing is that now I want to attach a script trigger to the function and it does not work On objectModify does not work at all. Any ideas? Best Wishes, Diego D'Alessio Buenos Aires - Argentina (the southernmost FileMaker Developer of the world?)
August 26, 201015 yr You are leaving out important information. You do not attach a script trigger to a function - you attach a trigger to a layout object and you designate a script that will be performed. What object did you attach the script trigger to? What user action modifies this object? What does the script look like? Do you know how to use script triggers? Can you post a copy of your file?
August 26, 201015 yr Author Newbies Hello Bruce! The function is called from a calculation field and yes, I've been using script striggers since day 1. The .fp7 can be downloaded from www.solucionesfilemaker.com/demos.html Thanks! DD
August 26, 201015 yr Hello Bruce! The function is called from a calculation field and yes, I've been using script triggers since day 1. The .fp7 can be downloaded from www.solucionesfilemaker.com/demos.html Thanks! DD But you did not answer most of the questions. The script is never called by anything. The script has an additional problem; it tries to change the value of a calculated field. There are no script triggers in your file and there is no object which has an "OnObjectModify" trigger attached to it. Edited August 26, 201015 yr by Guest
August 26, 201015 yr Bruce is right, you've got a function, being evaluated in a conditional formatting calculation box. I don't see how you're using this function to trigger a layout change. And I don't see how you can trigger script that calls this one a device orientation change.
August 26, 201015 yr Author Newbies Hello, at www.solucionesfilemaker.com/downloads/rotate-2.fp7 there is the script attached to the field. Best wishes, DD
August 26, 201015 yr Hello, at www.solucionesfilemaker.com/downloads/rotate-2.fp7 there is the script attached to the field. Best wishes, DD You can suppress the error with an exit script [ false ] statement. You can trigger it by trying to type in the calc field; but it still isn't clear what you're trying to do. You state "You can use this function , for example, to switch layouts via script triggers." but that isn't true. Or - to be more precise - the layout switching cannot occur if the only thing the user does is change orientation. We do not have a native script trigger for window changes so nothing except conditional format appearance of the text is going to happen if the only thing the user does is rotate the device. Edited August 26, 201015 yr by Guest
August 26, 201015 yr Author Newbies You can suppress the error with an exit script [ false ] statement. You can trigger it by trying to type in the calc field; but it still isn't clear what you're trying to do. You state "You can use this function , for example, to switch layouts via script triggers." but that isn't true. Or - to be more precise - the layout switching cannot occur if the only thing the user does is change orientation. We do not have a native script trigger for window changes so nothing except conditional format appearance of the text is going to happen if the only thing the user does is rotate the device. Gee... So the answer to my question seems to be "yes", I wrote an almost useless function. I assumed that, as the content of the field changes I was going to able to attach a script , 'onObjectModify' and voilá, Change to x Layout. But, as ObjectModify does not works with calculation fields, the end goal of my function will be almost impossible to achieve. Thanks Bruce!
Create an account or sign in to comment