Snapshot Link

I'm looking for help with a script issue. I need to open a snapshot link, but from my understanding it has to be the final step in the script. ?? So my FileMaker script step will not open. Here are the approaches we've tried so far:

  1. Directly opening the URL. With OpenURL script step.
  2. Making it the last step in a separate script and then calling that script.

Has anyone faced a similar challenge or have any suggestions for how to achieve this

I've never tried to script opening a snapshot link but it seems as though it should be fine. Ensure that it is in one of the known locations: server documents folder, the temp path on the user's machine, the user's desktop or in the user's documents path, or in a web accessible location.

What is your reason for thinking it has to be the last script step? And, of course, you've ensured that the particular snapshot link you are trying to open does open normally when double-clicked by the user.

We have built a few reports that utilise snapshots. Basically it's for manipulating the snapshot's XML to customise our own sort order for the final report.

You are quite right, the last step in the script is the one to open snapshot link.

I'm not sure what you're referring to about "my FileMaker script step will not open" - are you wanting to open the snapshot link and then carry out further execution on the snapshot data ?

One option to try is installing an onTimer. Before your last step of opening the snapshot, install a script to run, say 3 seconds in the future.

Then, open the snapshot. Once that happens and the snapshot found set is present, the onTimer should run.

OnTimers are window specific, so the onTimer is going to run in the originating window (not the new window of the snapshot) , but providing you can switch to the snapshot window, your script can then just do what it needs to do.

You could identify what the snapshot windows name is by checking the value of WindowNames function before the snapshot opens, with that of after the snapshot opens. There should be one extra window name present in the last list of window names - that will be your snapshot window name.

Obtaining that value does require either a while loop, or custom function. There is a good one on brian dunning which is effectively the opposite of the FilterValues function. It will take 2 lists, and give you values in listB NOT present in listA.

Good luck.

The onTimer tip was the solution to my problem!
Thank you !

Just wanted to say thank you for your reply, I had a co-worker explain what you meant. We ended up going with the same approach! Since I named the windows, I knew which window to come back to so it was pretty straight forward with the onTimer script step.
Although I didn't use the approach, the list of window names was a great idea!

1 Like

No worries @Drew , glad I could help out.

1 Like

We export Snapshot Links from our HelpRequest system using "Export Field Contents ; Automatically Open"

The Demo Script shown below opens 3 Snapshot Links, even thought we are opening them on line 16/22

1 Like

I really like this option, thank you for sharing!