Automation question - compile

I am using a simple way to automate Igor. I have a Perl script that submits a command like this one:
"path1\\Igor.exe" /X "String fileN="path2\\file1.ipf";OpenProc fileN;Execute "Func1()";Quit/N"

In other words, I am just using /X (Execute) instead of /Automation.
This worked at least once, but my current problem is that I need to manually compile the procedure before I can call the function.
In other words, after the command starts and Igor and successfully reads the procedure file file1.ipf, the procedure window displays the Compile button and I have to manually do that before the function Func1() will run. I tried compiling the procedure and then saving it again, so that Igor would read a compiled version, but that isn't working. If I manually open file1.ipf, then it doesn't require compilation, only when I open it from this command line using OpenProc.
Tom
You're right- you can't save a compiled version of a procedure file.

You need to look at Execute/P which has special keywords loading procedure files and causing Igor to do a compile. To learn more, copy this command and execute it on Igor's command line:

DisplayHelpTopic "Operation Queue"

You can also look at Igor's package loader procedure file which makes extensive use of Execute/P, though it does not do it via the Igor command line /X flag. Still, it will show you what Execute/P can do. First, execute this command:

SetIgorOption IndependentModuleDev=1

which will make the various independent modules visible. Then go to Windows->Procedure Windows->WMMenus.ipf.

You're talking about an advanced project here. Best of luck with it!

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
Hello John,
thanks!! This works beautifully. I had actually read the manual on Execute/P but didn't follow the reference to the queues, thinking I didn't need them, and searching the manual for "compile" was too tedious. Also, once I put one command on the queue, I needed to put all of them on, so that they don't change order (Quit/N shouldn't run first). The script command now looks something like this (real names abbreviated):
qx("p1\\Igor.exe" /X "String fileN="p2\\F1.ipf";OpenProc fileN;Execute/P "COMPILEPROCEDURES ";Execute/P "F2()";Execute/P "Quit/N"");

Tom