Running Script from Portal Row
Maybe someone can help me figure this out. I am designing a home automation controller with Filemaker Go to control Perceptive Automation's Indigo server software. Since FMGO cannot directly execute applescripts on the host machine, I have devised a way for FMGO to make http calls using variables that will call the applescripts inside the Indigo Server. So far so good.
I related two tables-my primary control surface table "Indigo" and a table called "albums" that is an import of my iTunes XML. I have a portal set up on an "Indigo" layout that correctly lists all artist/album combinations in my iTunes library. I then wrote a script that does the following:
When a portal row is clicked, the related record from "albums" is loaded, the "album" field is copied and pasted back to the original layout into a field called "albumtoplay" in the "Indigo" table. A web viewer is then set to make the proper http call to the Indigo server software. Here, I have an applescript that pulls the "albumtoplay" data from the current record of Filemaker Pro, and plays it in iTunes. Long story short, the script works perfectly from Filemaker Pro, does not work from Filemaker Go. I can see that the "albumtoplay" field is being set correctly in FMGO, but then the script seems to die.
Any thoughts as to why a portal would not be able to execute this type of action in FMGO? As an added note, if I assign a button on the "Indigo" layout to start the script after the "albumtoplay" field has already been filled, the script executes properly on FMGO. It seems to be some problem with the portal, or going to a related record prior to execution.
I'm sorry if this is convoluted, I don't know how to explain it better. Hopefully someone can figure this out. Much appreciated.