Jump to content

Shell scripts under Windows


drc
 Share

This topic is 5796 days old. Please don't post here. Open a new topic instead.

Recommended Posts

On my Mac in can run an Applescript to access a shell script thus:-

set the_data to (do shell script "/usr/local/bin/babel /Public/acetophenones.fs -osmi -xt -s 'c1ccccc1F'")

set cell "Results" of current record to the_data

Can I do something similar on Windows? If so can some give me a simple example?

TIA

Link to comment
Share on other sites

Yes you can, but it takes a few extra steps or a plugin. In all their wisdom, FMI forgot to implement the same functionality on Windows so the two products are not exactly on par when it comes to intergrating OS scripting.

Without a plugin:

- you need to make your VBscript syntax in a field

- export it to the hard disk

- use Send Event to execute it

- the VBscript in turn can run a FM script from the outside but it cannot pass a parameter, so you have to use the import engine to get your result back (after the VBscript writes it out to the hard disk). You'll find an example of this approach is the demoes section of FMforums, do a search there for my name.

With the VBscript plugin you can have the VBScript syntax from the field execute and immediately return the result into a field. There are currently two VBscript plugins:

www.grokittools.com

www.geistinteractive.com

Link to comment
Share on other sites

  • Newbies

I have a FM program that I will compile on both MAC and PC.

I need a way to produce ASCII TEXT (e.g. export).

I'm a beginner with FM, but from what I can tell, FM will not output clean ascii text.

1. All characters are 16-bit words (not 8bit). They have leading zero, which double the textfile size, and create problems with subsequent program which read my textfiles as input.

2. There seems to be no way to control the CR, LF, and CRLF.

I know its "possible" to post-process the exported textfile, but the problem is I'm giving my FM program to people who are on both PC and MAC, and I don't control what utilities or scripting languages they might have installed on their machines. On Mac, it's not a problem, since I can expect perl and tcsh to be there. On the PC, I don't know if I can every expect a particualr scripting/programming language to be there.

Any suggestions??

Is FM the wrong tool, for these who need to create files which are consumed by other applications? (is it called Filemaker, afterall)

Link to comment
Share on other sites

Windows has built-in scripting support so you can use VBscirpt, Jscript, Kixx and a few other languages without fear that they are not installed. Do a google on "windows script host" for more info. or go to www.microsoft.com/scripting

Link to comment
Share on other sites

This topic is 5796 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.