Re-visit of Suggesting a Path name to Load Waves_General()

 

I am running IGOR 6.0 on a MacBookPro (Mojave) and am stymied over a particular programming issue.

I will spare you the larger details of what I am doing by way of identifying just that part of my macro that identifies the essence of my problem.

I have an Experiment residing in a folder that has multiple files (containing waves) that I want to randomly choose from (via Load wave operation) to operate-on.

In essence, suppose I have a very simple Macro that I use to load waves. It is:

        Macro  See_Next_Case() : 

               Load_Waves_General()

        EndMacro

Here is what I wish to accomplish:   When I double click an IGOR Experiment file, and execute my See_Next_Case macro I want to be presented with a dialog box "pointing into the folder in which that Experiment resides".

Here is the problem: The FIRST time I double click the experiment and execute this macro, indeed this macro does exactly what I want, BUT, the 2nd (and all successive times) I execute my macro (from that experiment) the Load_Waves_General dialog box now points into my Mac "Documents" folder (not the folder containing the experiment); this requires me to do additional navigation to get back to the folder in which my experiment resides!

I am sure if I add proper arguments to the Load_Waves_General() command it can be made to open into the experiment's folder every time. The problem is, I am having difficulty finding (either in my manuals, or on-line) the execution format of the Load_Waves_General() command (that lists all the execution options), nor directions as to how to accomplish what I need.

Any help would be appreciated.

Dave (IGOR Neanderthal s/n 8250)

 

The home path is what you need. Works in Igor 9, 8, 7, ....

PathInfo home
Print s_path
DisplayHelpTopic "Symbolic Paths"

 

In reply to by tony

Thanks Tony,

Executing:

       PathInfo home
       Print s_path

does indeed confirm that "s_path" specifies the proper path to where I want to browse for wave files. But, I am still unable to properly hook all this together successfully, to wit:

Specifically, I am having trouble with determining the correct syntax for the call to Load_Waves_General which will cause it to open a dialog into the specified folder.

My simple macro now looks like this:

Macro SEE_NEXT_CASE() :
     PathInfo home  // set s_path to desired folder
     Print s_path      //confirm s_path
     Load_Waves_General() /P="s_path"
EndMacro

Maybe this isn't possible under IGOR 6?

Dave

What is the actual code in Load_Waves_General? That's what needs changing.

Just add "/P=home" to the LoadWave command it has, like this:
 

Proc Load_Waves_General()

   LoadWave/Q/G/A/P=home
   // more code here
End

 

Hi Jim,

Thanks for helping in this matter. I had forgotten that Load_Wave_General was my own macro, so was viewing it as an IGOR primitive (which also explains why I couldn't seem to find any documentation by that name :-)

This is what constitutes my Load_Waves_General macro:

      Macro Load_Waves_General()
             Loadwave /G /L={0,0,0,0,0} /A /W
      EndMacro

So, if I am understanding you correctly,

this should simply become:

      Macro Load_Waves_General()
             Loadwave /G /L={0,0,0,0,0} /A /W /P=home
      EndMacro

 

Dave

In reply to by JimProuty

Thanks Tony and Jim, problem solved and working like a charm (after I recovered from my "senior moment" :-).

As always, a joy to observe and be a part of the impeccable IGOR user community!

Dave (aka, Tetherman)