AnsweredAssumed Answered

Problems setting up a script to edit a photo in a container filed.

Question asked by HenryRobinson on Apr 11, 2014
Latest reply on Jun 20, 2014 by philmodjunk

Title

Problems setting up a script to edit a photo in a container filed.

Post

     Server OS: windows server 2008 R2 64 bit FileMaker server 12

     Client OS: windows 7 64 bit FileMaker Pro 12

     I am trying to make a Script that will do the following:

         
  •           Export an image from inside a portal to a temp folder and open it with the default program.
  •      
  •           The user can edit the file and save it.
  •      
  •           When the image was exported the database is sitting at a layout ready to continue. See image 1
  •      
  •           When the user continues it shows both the old image and the new image with an option to discard the changes or keep them. See image 2
  •      
  •           Once done you can see the new image put in the right field. See image 3

     The current script I have made almost works. The problem I am having is once I go back to edit the image I get an error message the file "?" could not be opened. (Not Found)

     At this point the image disappears.

     Script Steps

         
  •           Set Error capture [on]
  •      
  •           #set layout name for latter reference to return
  •      
  •           Set field [Cards::Variable Last layout; get (layoutnumber)]
  •      
  •           Set field [Cards::Variable Last portal row; get (activeportalrownumber)]
  •      
  •           #set location to export file
  •      
  •           set variable [$$filepath; Value: get (temporarypath) & getastext (container storage::container)
  •      
  •           Export filed contents [container storage::container; "$$filepath"; automatically open]
  •      
  •           Go to layout ["begin photo edit" (cards)]
  •      
  •           Insert File [Insert; display content; Never compress; Cards::currentphotoeditingbefore; "filepath"]
  •      
  •           Insert File [reference; display content; Never compress; Cards::currentphotoeditingafter; "filepath"]
  •      
  •           Refresh window

     when the user decides to accept the changes it runs this script

         
  •           Go to layout [Cards::Variable last layout]
  •      
  •           Go to portal row [select; no dialog; Cards::variable last portal row]
  •      
  •           Set filed [Container storage::container; cards::CurrentPhotoEditingAfter]
  •      
  •           #blank Variables
  •      
  •           Set Variable [$$filepath; Value: ""]
  •      
  •           Set filed [Cards::currentPhotoEditingAfter; ""]
  •      
  •           Set filed [Cards::currentPhotoEditingbefore; ""]

Currently_Editing.png

Outcomes