Jump to content
Server Maintenance This Week. ×

GetLayoutObjectAttribute() not working


normanicus

This topic is 2467 days old. Please don't post here. Open a new topic instead.

Recommended Posts

FM14, Mac Sierra, Google Chrome.

I have set up a script to scrape the title from the page showing in the Web Viewer. This was working fine.

Now I get nothing. One problem I solved. There was a message showing at the bottom of the web page referring to blocking third party cookies. I went into settings and allowed these. Still nothing.

I was using the FM16 Trial which ran out so I reverted to FM14 Advanced. I think this may be the problem because, when running file from Soliant which demonstrates interaction with Web Viewer, each time I run script it opens FM16 telling me the licence has run out. In the Finder I changed the default opener for FM files to Filemaker 14. Still does the same thing.

GetLayoutObjectAttribute is not exactly replete with error messages.

Hopefully, I am just being dumb and somebody will put me right.

Meanwhile I'm going through the hoop of trying to install the necessary packages in Python 3.6 so I can do this in Python. I know it's an aside but setting up Python in Sierra/OS X is not straightforward.

Link to comment
Share on other sites

I don't think you have given us anything to allow even a speculation as to what may be the problem. Is this problem restricted to a specific page or do you "get nothing" with any page you try? If the former, can you share the URL? And what exactly does "get nothing" mean? What do you see in the web viewer itself? And what exactly does your script do?

 

Link to comment
Share on other sites

I'm doing something like this:

Set Field [ globalTextField ; GetLayoutObjectAttribute ( “Magento” ; "source" ) - where 'Magento' is the object name of the WebViewer.

The contents of the Web Viewer is based on a URL stored in a field. I just put 'https://www.google.com' in that field and the Google search page appeared. Clicked the button with the above script step on it and the text field remains empty.

When it is working I put the results into a variable and extract the page title.

Let me know if more information is required.

Link to comment
Share on other sites

First of all, if your web viewer is showing Google's search page, then I would expect 

GetLayoutObjectAttribute ( “Magento” ; "source" ) 

to return:

https://www.google.com/

or something similar (Google normally redirects to your country's search page). If you're getting an empty result instead, then either you're not doing what you said you're doing or something is very wrong with your system. Easy to find out - just open the attached file, click the button and report the result.

 

wvtest.fmp12

Link to comment
Share on other sites

Thank you. I tested your file and it works as it should. Copy/Pasted the 'Get Content' button to my file and changed the field to the one I use. Nothing. Chose another, non-global field on the same layout, nothing.

So, as you said, something is going wrong. I never mentioned before but this was also failing on the client's computer so it looks like it is a corruption problem or similar.

Your test has shown it is neither the browser or FM14 causing the problem.

I'll try an older version of this file and then a 'Recover' and report back.

Link to comment
Share on other sites

Have you considered a much simpler possibility - for example a misspelling of the object's name? You could also post the file here (after reducing it to the bare minimum necessary to show the problem), so that we can have a look at it and see if we can reproduce your experience.

Link to comment
Share on other sites

Went back to an old backup and found one that works.

Did a Recover on the bad file and there were errors. Still the button didn't work. I'll paste your Web Viewer onto my layout and see what happens.

Link to comment
Share on other sites

Apologies for being slow to report back. I recovered the file but it made no difference. I left if a couple of days and then thought to delete my Web Viewer and paste in the one from the test file Comment provided. It worked. So, it was the Web Viewer that had become dysfunctional, maybe corrupted.

Thanks once again for your help.

Link to comment
Share on other sites

This topic is 2467 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.