Jasco Spectra Manager

From AutoHotkey

Jump to: navigation, search

Using AutoHotKey to convert Jasco Spectra Manager .jws files to ASCII .txt files

Unfortunately Jasco .jws files are in a proprietry binary format. This is considered a CLOSED format. The Jasco Spectra manager software will convert .jws files into plaintext, however you have to do this one file at a time. Normally this isn't a problem, however when you have hundreds of .jws files to convert this can become very tedious.

To date (2007/05/07) no quick .jws to .txt file converter exists. This setup is the best that is available until Jasco realizes that they should make a conveter and that it won't hurt their market position to do so.

There does exist a minimal portion of the Jasco software which you can use to convert their .jws files. What you need is:

  • jwstda32.exe - Spectra Analysis portion of the software
  • jwmemm32.dll - memory management library (1.50.0.7)
  • jwfile32.dll - Jasco CommonDlg Function (1.4.0.3)
  • jwdspm32.dll - Drawing Object Management library (1.50.0.9)
  • JwCanvLb.dll - Jascp Canvas library (1.0.1.7)
  • jaswin32.dll - Jasco Common library (1.50.0.2)
  • INSTRP32.dll - the guts of the previous version of the spectra manager (1.0.0.7)
  • c1dt_p32.dll - Spectra Data Processing library (1.50.0.5)

All of these can be found in your Spectra Manager folder, just copy these to a folder then start up the jwstda32 program, then quit it. It will create an initialization file called

jwstdanl.ini

open this file in a text editor and add this to it:

[FileSelect]
OpenType=*.jws
ViewDivision=ON
SaveType=*.txt

Now, you have a minimal program that you can use to save .jws files, however you need to automate the saving. Download and install the free program AutoHotKey from www.autohotkey.com, then start the program and allow it to open the Default script. Add this to the default script:

$+^s::
; this script starts with CTRL+SHIFT+s
; on start it requires a filename.
; By default it will pull in text from the active window, or clipboard

;
; this ugly bit of code will find a filename from the active panel
;
; make sure that window is active and known
WinGetTitle, Title, A
; get the text on the screen
WinGetText, text, %Title%
text_lines=%text%
; pull out the first line only
; it contains the most active panel in the Spectrum Manager window
StringSplit, split_names, text_lines, `n
first_line=%split_names1%
; discard everything before and including the open parenthesis
StringSplit, parsed_line, first_line, (
working_text=%parsed_line2%
; discard everything after and including the file extension
StringSplit, useable_name, working_text, .

;
;
; Here's where the default filename is set
; if you want to use input from the clipboard, change this to
;  filename_in=%clipboard%
;
filename_in=%useable_name1%
;
;

InputBox, filename, Filename for converted file, Type in a filename (no jws extension), , , , , , , , %filename_in%
if ErrorLevel
   ; if cancel was selected, then end
   return
else
; if okay was selected then do this stuff
Click 15,40          ; click on the 'File' menu
Sleep, 100
Click 15,120         ; click on the 'Save as...' command
winWait Save As      ; waits until 'Save as' box is open
Send %filename%      ; types 'filename' into the box
Sleep, 100
Click 360,220        ; click on the 'Ok' button
WinWaitClose         ; waits until the 'Save as' box is closed
Click 15,40          ; click on the 'File' menu
Sleep, 200
Click 15,90          ; click on the 'Close' command (to close the current window
MouseMove, 90, 90    ; moves the mouse to a convienient location
return

Quit AutoHotKey, then restart it. Now start up the jwstda32 program. Choose open and navigate to the .jws files you want to convert. Open them all at once. Make sure that the MultiView option is checked (it should be). Don't be horrified when all the spectra open up in different windows. Maximize the jwstda32 program so that it takes up the whole screen. Now look at the topmost spectra, and come up with a name for it. Now hit this key combo CTRL+SHIFT+s AutoHotKey should kick in and start up by asking you for a filename. By default, it will try to save the converted .jws file into the same directory with the filename that you type into the box. If you need it to do something different, then modify the AutoHotKey script.


Have fun!


Someone should probably:

1) write a patch to patch one of the .dll files so that when a file is saved as a .jws, it's also saved (with the same name) as an ASCII .txt

2) look at the startpoints of the .dll files to make a standalone file converter (using their .dll's)... See DllCall()'

Personal tools