Set a variable to set the "Open Experiment Dialog Box" root folder?
reepingk
All of my data and igor experiments are in a single folder (with multiple subfolders.) However, this folder is deep in my home directory. It's slightly annoying to have to find my "data" folder every time I open igor, more annoying when I have to dig deeper into the hierarchy. Even more annoying when igor doesn't remember which folder I'm working in and resets it's folder back to the home folder. Can I write a script that sets the default root directory for igor so that when I "Open" an experiment or "Load waves" it automatically goes to that folder? It's most annoying with some of my scripts. My scripts often have "open file" dialogs, where I select multiple files for the macro to process. Those dialogs often revert back to my home directory, so when I have to run that macro 2-5 times, it gets annoying. (And no, it's not something I can or want to loop within the macro itself. The 2nd-5th times I run the program depend on the results from the 1st, so the files I choose for the 2nd depend on what I see the first time around.) I'll probably just find a way to make it run every time I start igor if it's something I have to run and not just set from a preference file or similar.
Thanks!
September 10, 2015 at 09:43 am - Permalink
I see that the Pathinfo command would work.
I could simply do a
String DataFolderPath="Path:To:DataFolder"
NewPath DataFolder, DataFolderPath
PathInfo /S DataFolder
when I start igor and it should just open from there. Then I could change it depending on which folder I was working in.
Alternatively I could change the plist file in the application settings folder to change the directory (until it changes again due to me navigating.) How often is the plist file updated?
Now, the next question is this, is there anyway to run a script on Igor startup unattended? (Meaning I wouldn't have to launch it.)
September 10, 2015 at 10:02 am - Permalink
Put an IgorStartOrNewHook function like this in a procedure file in your Igor Procedures folder.
Make sure auto-compile is on.
String appstr
Print "Igor starting up..."
// Put your code here
return 0 // don't circumvent other IgorStartOrNewHooks.
End
--Jim Prouty
Software Engineer, WaveMetrics, Inc.
September 10, 2015 at 11:15 am - Permalink