Hi Bob,

I guess I would have been surprised if a backdoor existed.  Thanks for thinking about this.

—Chuck

On Feb 5, 2014, at 4:45 PM, Robert Hanson <hansonr@stolaf.edu> wrote:

PNGJ is not designed to save any settings other than those that are specifically necessary to define a state. So no user variables, no overall preferences. You could save a "message" in the state by using the message command, I suppose, but that would have to be a message that was visible to the user. Oh, and perhaps in some relatively unused variable such as

set nmrpredictformat "testing messages here"

This would be human- or machine-readable in the state associated with the PNGJ file if reopened by Jmol.

Although, come to think of it, I think I will remove that from the state. So don't consider this method supported!


Bob



On Mon, Feb 3, 2014 at 11:44 AM, Alexander Rose <alexander.rose@weirdbyte.de> wrote:
Hi,

I am also quite interested in that.

> Can I save my app’s private UI state (preferences, etc) as a variable
> or static function in JSmol so that PNGJ will write it to the .png
> file?

As far as I know user defined variables or functions (from jmolscript)
are not saved within the Jmol state.

The idea I have in the back of my mind is to use a file format Jmol understands
and have my data (your private state) piggybacking in that file. May be as a
comment in some file or in a jmol script file. Though I have not tried anything
yet.

I would welcome a solution supported by Jmol itself.

> (I can imagine the user saving the PNGJ .png file to (say) a Google
> Drive repository.)
>
> Can I get the PNGJ output as as a JSON object to save in browser’s
> localStorage and use with a Jmol script “load …”?
> (I can imagine using the browser’s localStorage as a way for the user
> to pick up working on something that hadn’t yet been saved to (say)
> the Google Drive repository.
>

Apparently you can save blobs in localStorage [1]. YOu can of course also
save your private state in localStorage along side of the PNGJ but then you
do not have everything in a self-contained file.


Best
Alexander


[1] https://hacks.mozilla.org/2012/02/saving-images-and-files-in-localstorage/

------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users



--
Robert M. Hanson
Larson-Anderson Professor of Chemistry
St. Olaf College
Northfield, MN
http://www.stolaf.edu/people/hansonr


If nature does not answer first what we want,
it is better to take what answer we get.

-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900

------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users