Hi J-P you mean you want to have it import a hard-coded specific file name instead of asking you for the filename?
It should be possible to do that by modifying the script. To do that open up the file ImportPointFile.js in notepad and look for the section that has this:
code:
function ImportPointFile()
{
var filename = moi.filesystem.getOpenFileName( 'Choose a point file', 'Point files (<...>) );
<....>
That line that says var filename = .... is the one that is triggering the file dialog to ask you to select a name.
If you change that line to put a specific path in there then it should work like you want.
The way you would do that is to make that line say something like this:
var filename = 'c:\\some folder\\myfile.txt';
So a couple of things to note there - put quote characters ' ' around the whole name, and for every backslash you actually need to put in 2 backslashes. That's because a backslash is an "escape" character for strings where certain combinations are used for special characters like \r means put in a carriage return character into the string. So to make a single backslash character you need to do \\ .
Let me know if you still aren't able to make it work like you need.
- Michael
|