Path not registering as string

I'm trying to load data from my Macbook. I wrote this function:

 

Function waveloader(fullpath)
    string fullpath
    LoadWave fullpath
end


and used this (and variations of) this command:

waveloader(:Macintosh HD:Users:username txtfile.txt)

I get the "Expected string variable or string function" error. Sometimes I get "Got "Macintosh" instead of string variable or string function name."


My understanding of the function I wrote is:

I create a function named waveloader which is looking for an object called fullpath. I then define fullpath as a string. I then look to use the built-in LoadWave function to access the string fullpath, and accept that as input. Then the function ends.

Is a file path not a string?

Try this:
waveloader("Macintosh HD:Users:username txtfile.txt")


Also LoadWave without a /G, /J or /F flag tries to load an Igor binary wave file. Use the Data->Load Waves->Load Waves dialog to generate the appropriate command for your file.
Cool, thank you! I've added the /G flag and I'm able to load a wave, but I have to select the file from Finder, the Macintosh file browser unless I add a colon between username and txtfile.txt. Is this normal? It looks like the help file shows a space between the location of the file and the file name with extension.

The Data --> Load Waves --> Load Waves dialog produces this

General text load from "txtfile.txt"
Data length: 180, waves: System_Clock__s_, Time__ps_, Axis_1_Position___m_, Inphase__X___V_
and: Quadrature__Y___V_, Magnitude__V_, Phase_Angle__deg_

which now matches the output of my function:

Function waveloader1(fullpath)
    string fullpath
    LoadWave/G/W/A/O fullpath
end

Is there a way to show the command or procedure that would be used to achieve the same result as an Igor GUI?
geologic wrote:
The Data --> Load Waves --> Load Waves dialog produces this

General text load from "txtfile.txt"
Data length: 180, waves: System_Clock__s_, Time__ps_, Axis_1_Position___m_, Inphase__X___V_
and: Quadrature__Y___V_, Magnitude__V_, Phase_Angle__deg_


If you choose Data->Load Waves->Load Waves the dialog will generate a command and add it to the history area where you can inspect it. You quoted the output from the command, not the command generated by the dialog.

The help for LoadWave explains the conditions under which it displays an Open File dialog.
Sorry, I don't see the command that the Igor GUI is generating when I use the dialog...I only see the output. Where can I find the command?

Thanks.
Sorry, I don't see the command that the Igor GUI is generating when I use the dialog...I only see the output. Where can I find the command?

Thanks.
Choose Data->Load Waves->Load Waves. If you don't see the Load Waves dialog, which has a Do It button in the bottom/left corner and a command box above the Do It button, then you did not choose Data->Load Waves->Load Waves.

If you choose Data->Load Waves->Load Waves the dialog will generate a command and add it to the history area where you can inspect it.