Jump to content

greerso

Members
  • Content Count

    26
  • Joined

  • Last visited

Community Reputation

0 Neutral

About greerso

  • Rank
    newbie
  • Birthday 07/23/1972

Profile Information

  • Gender
    Male

Recent Profile Visitors

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

  1. Rasterize.js from the shell is how I am and have been running it. I was looking for a way to make it more self contained and possibly more powerful and flexible. Do you think that its not possible to use Selenium in a Scriptmaster function? Do you know why the script would run in GroovyConsole and not in Scriptmaster, I would like to try to understand why it doesn't work?
  2. You can have your calc remove the http:// using any one of the many text functions. Here are some simple examples: Right ( Product::Image1 ; Count ( Product::Image1 ) - 7 ) That counts the number of characters in the field, then displays all but the first 7. That wouldn't catch https:// and if it didn't contain a http:// it would remove the first 7 when you dont want it to. Substitute ( Product::Image1 ; "http://" ; "" ) Looks for "http://" and if found replaces it with nothing.
  3. I think what you want to do is make ImageCode a calc field where the calc is: "data:text/html, <html> <body> <img src='" & Product::Image1 & "' style='width:100%; height:100%'/> </body> </html>" If Product::Image1 is a full url including "http://" this calc will not work. That field would need to contain "images.website.com/image1.jpg" without the quotes for it to work.
  4. I have created a scriptmaster function to upload to s3 and return a signed url using amazons jets3t.jar that is working for me. RegisterGroovy( "UploadToS3( keyAccess ; keySecret ; bucket ; filePath ; daystoexpire )" ; "import org.jets3t.service.impl.rest.httpclient.RestS3Service¶ import org.jets3t.service.model.S3Bucket¶ import org.jets3t.service.model.S3Object¶ import org.jets3t.service.security.AWSCredentials¶ ¶ accessKey = keyAccess¶ secretKey = keySecret¶ bucketName = bucket¶ uploadFile = filePath¶ int expiryDays = Integer.parseInt(daystoexpire)¶ ¶ credentials = new AWSCredentials(acce
  5. I have created a scriptmaster function that uploads a file to an s3 bucket and returns a signed url. If you're interested here is the code: RegisterGroovy( "UploadToS3( keyAccess ; keySecret ; bucket ; filePath ; daystoexpire )" ; "import org.jets3t.service.impl.rest.httpclient.RestS3Service¶ import org.jets3t.service.model.S3Bucket¶ import org.jets3t.service.model.S3Object¶ import org.jets3t.service.security.AWSCredentials¶ ¶ accessKey = keyAccess¶ secretKey = keySecret¶ bucketName = bucket¶ uploadFile = filePath¶ int expiryDays = Integer.parseInt(daystoexpire)¶ ¶ credentials = new AWSCre
  6. Thanks for the tips. I hadn't considered SMGetVariable(), I was thinking that i'd return both hashes and the value of difference in a value list, then use Filemaker to GetValue from the result. Those single quotes will sure make life easier too. I should also have mentioned if not already obvious that I made 3 separate functions so that I can generate hashes as I go and compare later.
  7. I'm using the java project "selenium" with "ghostdriver" and phantomjs as my browser to create screenshots of web pages. My code works perfectly in groovyConsole but has an error with the phantomjs driver once inside Scriptmaster. I think the problem may be that it requires access to a binary phantomjs that is not part of the jars. This is the code that executes in groovyConsole and produces a screenshot: import java.io.File import java.util.concurrent.TimeUnit import org.apache.commons.io.FileUtils import org.openqa.selenium.OutputType import org.openqa.selenium.TakesScreenshot imp
  8. A year has passed and I figured I'd post an update to my original post to help any others new to programming that might attempt to create their own scriptmaster functions. I have learned that many of my initial problems were due to a couple of Filemaker/Scriptmaster limitations that are important to understand: Filemaker is a 32bit Application and requires a 32bit Java Virtual Machine, this means Java 1.6. Any jars must be compiled using JDK 1.6. Scriptmaster uses version 2.0.6 of Groovy, so code that works in a recent download of groovyConsole may not work and may need some edit
  9. Thanks for taking the time to reply in detail. I had actually considered documenting my experience and will certainly do that once I'm confident I have information that will be helpful to others in my position. Google has given me lots of information on Groovy in the context of Grails and web development which is not making it easy for me to figure out how that could apply to ScriptMaster. I've run though a few tutorials, what is confusing me is when i learn that unlike Java, in Groovy "return" isn't needed, yet Groovy in ScriptMaster requires you to "return" a result. With Java t
  10. If you are saying that you have a text field with a path to a file, it is very easy to replace the contents of all fields containing C:/mypath.... with E:/mypath... using the "Replace Field Contents" option in the "Records" menu to update a field in all records of the current found set. There is no undo, so do it on a copy of your database to make sure you're getting the expected result. If you have FMP Advanced you can try the calculation in the data viewer first to make sure you're getting what you want. The calc could look something like "Substitute ( self ; "C:/" ; "D:/" ). If not a
  11. I would check that in addition to loading the scriptmaster plugin that you are also registering the function. I do this in as a "set variable" in the startup script. It doesn't matter what you name the variable, but you have to be sure to paste the scriptmaster groovy code for your module into the value for the variable. In your case it sounds like you're using a few modules so you'll have to set variable for each of them. This page will give you all the information you need http://360works.com/plugins/SCRIPTMASTERPLUGIN/documentation.html. I've run into problems with the plugins in
  12. I'll start with a disclaimer that I'm no expert. I do know enough about Filemaker to answer your questions though. Radio button and checkbox sets in Filemaker come from value lists, its only an interface item, and does not change the field in the table. Only the value or values selected are stored in the record, so in Excel you will want to make sure you only store a value that is on your value list in Filemaker (if you don't it will still import just fine). For multiple values, as in the case with checkboxes you will want your value's in the Excel cell to be either return or comma sepa
  13. I'm interested in learning how to create a ScriptMaster module from scratch and have read the documentation at http://360works.com/plugins/SCRIPTMASTERPLUGIN/documentation.html and ran through the tutorial at http://groovy.codehaus.org/Beginners+Tutorial. 360Works.com told me what I already know about the usefulness of ScriptMaster and how to use existing modules, codehaus.org gave me a (very)basic understanding of groovy code. I'm looking for pointers on how to write a simple ScriptMaster module from scratch, any do's and dont's and tips on taking sample java code and editing it to make
  14. Got it. It was actually the other script on the button that needed the refresh. Thanks again for the help.
  15. Thanks for the tip, but that didn't fix the problem for me, same result.
×
×
  • Create New...

Important Information

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