OpenNotebook
OpenNotebook [/A /ENCG=textEncoding /K=k /M=messageStr /N=winName /P=pathName /R /T=typeStr /V=visible /W=(left,top,right,bottom) /Z] [fileNameStr ]
The OpenNotebook operation opens a file for reading or writing as an Igor notebook.
Unlike the Open operation, OpenNotebook will not create a file if the specified file does not exist. To create a new notebook, use the NewNotebook operation.
Parameters
The file to be opened is specified by fileNameStr and /P=pathName where pathName is the name of an Igor symbolic path. fileNameStr can be a full path to the file, in which case /P is not needed, a partial path relative to the folder associated with pathName, or the name of a file in the folder associated with pathName. If Igor cannot determine the location of the file from fileNameStr and pathName, it displays a dialog allowing you to specify the file.
If you use a full or partial path for fileNameStr, see Path Separators for details on forming the path.
Flags
| /A | The notebook's selection is moved to the end of the notebook. | ||||||||||
| /ENCG=textEncoding | Specifies the text encoding of the plain text file to be opened as a notebook. | ||||||||||
| This flag was added in Igor Pro 7.00. | |||||||||||
| This is relevant for plain text notebooks only and is ignored for formatted notebooks because they can contain multiple text encodings. See Plain Text File Text Encodings and Formatted Text Notebook File Text Encodings for details. | |||||||||||
| OpenNotebook uses the text encoding specified by /ENCG and the rules described under Determining the Text Encoding for a Plain Text File to determine the source text encoding for conversion to UTF-8. | |||||||||||
| Passing 0 for textEncoding acts as if /ENCG were omitted. | |||||||||||
| See Text Encoding Names and Codes for a list of accepted values for textEncoding. | |||||||||||
| /K=k | Specifies window behavior when the user attempts to close it. | ||||||||||
| |||||||||||
| /M=messageStr | Prompt message text in the dialog used to find the file, if any. | ||||||||||
| /N=winName | Specifies the window name to be assigned to the new notebook. If omitted, Igor assigns a name like "Notebook0". | ||||||||||
| /P=pathName | Specifies the folder to look in for the file. pathName is the name of an existing symbolic path. | ||||||||||
| /R | File is opened read only. | ||||||||||
| /T=typeStr | Specifies the type or types of files that can be opened. | ||||||||||
| /V=visible |
| ||||||||||
| /W=(left,top,right,bottom) | |||||||||||
| Specifies window size and position. Coordinates are in points. | |||||||||||
| /Z | Suppresses error generation. Use this if you want to check if a file exists. If you use /Z, OpenNotebook sets the variable V_flag to 0 if the notebook was opened or to nonzero if there was an error, usually because the specified file does not exist. | ||||||||||
Details
The /A (append) flag has no effect other than to move the selection to the end of the notebook after it is opened.
If you use /P=pathName, note that it is the name of an Igor symbolic path, created via NewPath. It is not a file system path like "hd:Folder1:" or "C:\\Folder1\\". See Symbolic Paths for details.
The /T=typeStr flag affects only the dialog that OpenNotebook presents if you do not specify a path and filename. The dialog presents only those files whose type is specified by /T=typeStr. There are two file types that are allowed for notebooks: 'TEXT' which is a plain text file and 'WMT0' which is a WaveMetrics formatted text file. Therefore, the file type, if you use it, should be either "TEXT" or "WMT0". If /T=typeStr is missing, it defaults to "TEXTWMT0". This opens either type of notebook file. On Windows, Igor considers files with ".txt" extensions to be of type TEXT and considers files with ".ifn" to be of type WMT0. See File Types and Extensions for details.