The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Run a script from the commandline?

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
dlw21 Posted - 02/04/2003 : 3:58:24 PM
Hi Folks,

I was wondering if it would be possible run an .OGS file from either the commandline directly, or by dragging and dropping the OGS file onto the Origin icon...

The task I am trying to accomplish is this: I have some tools with buttons and things that I'd like to be able to install with a simple call to the "installer" script, either like:

origin70.exe Package.ogs

or by dragging and dropping onto the executable. This would provide a brain-dead way of sharing my tools with my collaborators.

(I use OriginPro 7 (network version).)

This may look familiar, since one possible way of doing this would be via the OPKSetup.ogs mechanism automatically run when a .OPK file is unpacked. Unfortunately, I am interested in something more generic and the OPK method doesn't *quite* work for me. (related question: do OPK files support directory structures within them?)

I've not found anything like this in the documentation, and just trying it out didn't work the way I'd hoped.

Any suggestions?

If this capability doesn't currently exist, might I suggest it be considered for future releases?

Thanks,
Dave

1   L A T E S T    R E P L I E S    (Newest First)
Mike Buess Posted - 02/04/2003 : 6:41:01 PM
Hi Dave,
quote:
I was wondering if it would be possible run an .OGS file from either the commandline directly, or by dragging and dropping the OGS file onto the Origin icon...
If you drop an OGS file onto Origin it should just open in CodeBuilder. To find out how to run a script from the command line read the "Running scripts at startup" topic at labtalk.nmrtools.com.

Having said that, OPK is really the best way to go and the answer to your related question is yes. To create a directory structure in the Origin program folder just make a file list using relative paths...

OPKname.opk // The name of your OPK file has to appear first
OPKSetup.ogs
Package.ogs
myfolder\1stfile
myfolder\2ndfile
myfolder\subfolder\3rdfile
etc.

Save the list as a simple text file, say OPKname.txt. (If you have a complicated directory structure with lots of files you can use the free OFileMan add-on to make the list or write your own OriginC function as I've done.) Then create the OPK file...

dll -a Opack Opack;
opack.saveFolderInfo=1; // save your directory structure
opack.getFileNames(%YOPKname.txt);
opack.pack();
dll -r opack;

OPKSetup.ogs can be as simple as this...

#OPKSetup.ogs
[OnBeforeSetup]
// This runs before the files are unpacked
opack.useFolderInfo=1; // unpack according to your directory structure

[OnAfterSetup]
// This runs after the files are unpacked
run.file(Package.ogs);
-- or more likely --
run.section(Package,SectionName);

If for some reason you don't want to install your files via OPK you can still launch the installer script with an OPK file containing only an OPKSetup that looks like this...

[OnAfterSetup]
run.section(Package,SectionName);

I've been distributing Origin add-ons since Origin 5.0 and OPK is definitely the best installation mechanism I've tried so far.

Mike Buess
Origin WebRing Member

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000