![]() ![]() ![]() ![]() The house icon on your point and click file browser represents your "home directory", and is a graphic representation of something like /Users/, or C:\Users\. "Directory" is the older name for "folder" that is commonly used by programmers. Each slash (forward slash in Mac and Linux, backslash in Windows) represents a "directory". In Praat scripts, when you are going to read (open) or write (save) a file, you use paths and write them in the format above, you are not going to emulate point and click behavior. VidFile$ = "C:\Users\daniel\Desktop\myVideos\Graduation.mp4" VidFile$ = "/Users/daniel/Desktop/myVideos/Graduation.mp4" VidFile$ = "/home/daniel/Desktop/myVideos/Graduation.mp4" These nice user interfaces somewhat obscure the fact that this file's full name (full path) is something like this (I'm saving the path name to a string variable, vidFile$): This is definitely a user-friendly way of doing things in a point and click environment. We're used to interacting with that file through something like Mac's Finder or Windows' File Explorer, where we click our way to the file, navigating through folders as if they were "places". Let's pretend we have a folder on our Desktop called "myVideos", that contains a movie file called "Graduation.mp4". So, what is a path? A path is essentially a location on your file system, aka the name of a file or folder. This chapter's goal is bring you up to speed on how files are named programmatically, allowing you easily open and save files from your scripts, and understand any errors when you've made a mistake. I'm under the impression that with more recent upgrades of Praat some of this has been made easier. Maybe you've had the experience of trying to get a script to open or write a file, and been driven mad with a "File not found" error. I personally found paths to be a big pain in the kiester when I first started programming and programming for Praat. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |