Yes, I think we are all set. Took some rearranging of code, but it is all
there now. Great idea. Jonathan, do you know how to create ZIP files?

We could perhaps implement:

write ZIP xxxx.zip

which would put it all together, perhaps with the state script also embedded
in a JPG. (If you haven't tried that, you should. It's quite startling --
save a JPG, then just drag/drop it back into Jmol. Or display the JPG on a
web page, and also do

  script "myfile.jpg"

Bob


On Fri, Sep 4, 2009 at 8:18 AM, Jonathan Gutow <[email protected]> wrote:

> Dear All,
>        Based on what Bob has done below for relative file paths I think we
> (Bob?) can now make a compressed jmol save file, which is something I
> was considering doing based on the jmolInstance used for web export.
>
>        Here's my idea:
> 1) Copy the data file, state script and any jvxl files associated with
> view in a single directory with a user chosen name.
> 2) The state script would need to use the appropriate relative paths
> (now easy, I think).
> 3) Zip this into one file with the name <directoryname>.jmol.
> 4) If I remember how Jmol opens things, I think we can open this file
> directly and it could be passed from machine to machine without a
> problem.
> 5) There are still some issues with updating.  I like the safe update
> method.  a) Write updated file with a temporary name.  b) Upon
> successful write erase old file and rename new to the old file name.
>
> I was going to use something like this for the multi-viewer we once
> discussed, but haven't had time to work on that.
>
> What do people think?
>
> Jonathan
> On Sep 3, 2009, at 5:19 PM, SourceForge.net wrote:
>
> > Feature Requests item #2837721, was opened at 2009-08-14 10:40
> > Message generated for change (Comment added) made by hansonr
> > You can respond by visiting:
> >
> https://sourceforge.net/tracker/?func=detail&atid=379136&aid=2837721&group_id=23629
> >
> > Please note that this message will contain a full copy of the
> > comment thread,
> > including the initial issue submission, for this request,
> > not just the latest update.
> > Category: None
> > Group: None
> > Status: Closed
> > Priority: 5
> > Private: No
> > Submitted By: Christopher King (popnose)
> > Assigned to: Nobody/Anonymous (nobody)
> > Summary: Use relative address in state files
> >
> > Initial Comment:
> > On one computer, a file, 1edn.pdb, was opened.  The state was saved
> > as 1edn.spt in the same directory as 1edn.pdb.  Both files were
> > transferred to the same directory on another computer.  On that
> > computer, the state file gave an error because the directory
> > structure was different than on the original computer.  Can the
> > state file be changed to use a relative address for the original
> > file?  Then, I could transfer state files from office to classroom
> > and not have to worry as much about having the same directory
> > structure.
> >
> > ----------------------------------------------------------------------
> >
> >> Comment By: Bob Hanson (hansonr)
> > Date: 2009-09-03 17:19
> >
> > Message:
> > one more comment. This works by finding
> > /*file*/"http://rcsb.org/pdb/files/1crn.pdb"; in a state script. If
> > you had
> > your own script, you could do the same; just make sure you have /
> > *file*/
> > immediately preceding a double-quoted file name.
> >
> >
> > ----------------------------------------------------------------------
> >
> > Comment By: Bob Hanson (hansonr)
> > Date: 2009-09-03 17:15
> >
> > Message:
> > OK, this is done. See Jmol 11.9.2
> > (http://chemapps.stolaf.edu/jmol/docs/examples-11/Jmol-11.zip and
> > http://chemapps.stolaf.edu/jmol/docs/examples-11/new.htm)
> >
> > There are two new options for SCRIPT and WRITE STATE commands. These
> > are
> > LOCALPATH and REMOTEPATH. Each takes an argument in quotes. Setting
> > the
> > LOCALPATH replaces any file reference in the script, either on
> > reading or
> > writing, to that path; setting REMOTEPATH does the same for anything
> > with
> > an "http" "https" or "ftp" prefix. So, for example, if you have a
> > state
> > that refers to files on a local file system and now you want to run
> > it but
> > load files from a different system, you would do something like this:
> >
> > script LOCALPATH "" "myfile.spt"
> >
> > That says, "whatever the local file path to a file accessed by this
> > script
> > command, (in LOAD or SCRIPT commands, for example), make them come
> > from the
> > current directory. (This might be on a web host or another local
> > machine.)
> >
> >
> > script LOCALPATH "data" "myfile.spt"
> >
> > would set all local file references to data/....
> >
> > If the file reference already contains .../data/... in its path,
> > then it
> > is simply truncated to data/....
> >
> > Same for REMOTEPATH, but here we are changing only the remote file
> > references. So, for example, if you had used
> >
> > load =1crn
> >
> > and then saved the script as "myfile.spt", that script will have in
> > it:
> >
> > load "http://rcsb.org/pdb/files/1crn.pdb";
> >
> > So, say now I have that file on disk and don't want to go back to the
> > server for it. Then I just say:
> >
> > script REMOTEPATH "" "myfile.spt"
> >
> > This will now read 1crn.pdb from the local drive but otherwise run the
> > same.
> >
> > Bob Hanson
> >
> >
>
>                          Dr. Jonathan H. Gutow
> Chemistry Department                                 [email protected]
> UW-Oshkosh                                           Office:920-424-1326
> 800 Algoma Boulevard                                 FAX:920-424-2042
> Oshkosh, WI 54901
>                  http://www.uwosh.edu/faculty_staff/gutow/
>
>
>
>
>
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus
> on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Jmol-developers mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jmol-developers
>



-- 
Robert M. Hanson
Professor of Chemistry
St. Olaf College
1520 St. Olaf Ave.
Northfield, MN 55057
http://www.stolaf.edu/people/hansonr
phone: 507-786-3107


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
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Jmol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers

Reply via email to