Jump to content

john renfrew

Members
  • Content Count

    672
  • Joined

  • Last visited

  • Days Won

    23

john renfrew last won the day on January 30

john renfrew had the most liked content!

Community Reputation

44 Excellent

About john renfrew

  • Rank
    enthusiast, with a bit of geek
  • Birthday 06/21/1957

Profile Information

  • Gender
    Male
  • Location
    UK

Contact Methods

  • Website URL
    http://attitude.upright-group.com
  • Skype
    rwu2359

FileMaker Experience

  • Skill Level
    Intermediate
  • FM Application
    16 Advanced

Platform Environment

  • OS Platform
    Mac
  • OS Version
    Sierra

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Are you just using the version within the sample file???
  2. OK answering own question make the shell script executable then go to the System Setting and grant explicit access to two things to give the script access to write over to external hard drive, bash and fmserver_helperd
  3. Have copied a shell script which works in other settings onto a new machine Changes paths - it zips a backup folder and does a ditto command to copy as a zip file to an external drive I worked out that I needed to change the sudoers file to allow no password access to the script. Running the shell script in terminal was requiring a password, now it doesn't Added the fmserver user to that too. If I run the sh script from the admin console as fmserver it fails straight away, if I run it as the local user with its password it appears to run but in fact times out with a fail message, both of which are about invalid account name or password The script is working fine when run through terminal, doe not require password, just not when triggered from console. Does anyone have any light to shine on this???
  4. What you get back is JSON version of the information you asked the function for.. so instead of SMGetVariable calls you would use JSONGetElement instead.. The benefit was to show how this was possible - not to make you change how you do things, it's up to you if change your implementation, but was to show how to export the data out as a JSON block
  5. Those error codes are FileMaker error codes afaik therefore 102 == field missing Groovy errors will refer to things like class issues or things like inability to do an action on a null object..
  6. after the vsm_Image = line needs a ¶ at the end if you literally copy/paste
  7. I presume at the moment you are doing lots of SMGetVariable calls after running this function If you added the return statement right at the end you would get back all the answers as a transformed JSON block you could process in a different way...
  8. you could also be really smart and return the whole thing as a JSON block too... (this definitely needs SM 5.2+) return JsonOutput.toJson([vsm_titre: vsm_titre, vsm_auteur1: vsm_auteur1, vsm_auteur2: vsm_auteur2, vsm_nbPages: vsm_nbPages, vsm_Editeur: vsm_Editeur, vsm_Image: vsm_Image])
  9. The issue is that these books have no authors - so it fails quite early on... I changed the code to test for each presence
  10. can you post the sample URL?? I am pretty sure it might be because the 'cover' node does not exists and so it can't find the medium sub-node on it... try replacing the line with... vsm_urlImage = keySet.cover?keySet.cover.medium:null
  11. Try this RegisterGroovy( "JSON2FMP( url )" ; "import groovy.json.*¶ ¶ vsm_titre = vsm_auteur1 = vsm_auteur2 = vsm_nbPages = vsm_urlImage = vsm_Image = vsm_Editeur = ''¶ ¶ parsedResponse = new JsonSlurper().parse(new URL(url))¶ ¶ if (parsedResponse.size() == 1 ){¶ root = parsedResponse.keySet()[0]¶ keySet = parsedResponse.\"${root}\"¶ ¶ vsm_titre = keySet.title?:''¶ ¶ vsm_auteur1 = keySet.authors[0]?keySet.authors[0].name:''¶ vsm_auteur2 = keySet.authors[1]?keySet.authors[1].name:''¶ vsm_nbPages = keySet.number_of_pages?:''¶ vsm_Editeur = keySet.publishers.name?:''¶ vsm_urlImage = keySet.cover.medium?:null¶ ¶ vsm_Image = vsm_urlImage?new URL ( vsm_urlImage ):''¶ ¶ } else {¶ return ''¶ }" ; "isGui = false" ) it just tests each node is there and then extracts the value if it is
  12. I have client machine Mac 10.15.something and latest ScriptMaster For some while the plugin seems to turn itself off after being used successfully The machine was recently updated, and I was in yesterday to install FMP18.0.3 but this morning I am getting error notifications which are because it has turned off again. Can you offer any light on why this might be and how to go about troubleshooting it??
  13. can you post your function Noel... I have used open books already.. john
×
×
  • Create New...

Important Information

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