O'Reilly logo

AppleScript® Programming for the Absolute Beginner by Jerry Lee Ford

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Retrieving File and Folder Information

AppleScript gives you access to information about files and folders through the info for command, which has the following syntax.

info for file FileName

FileName represents the complete path and filename of the file or folder for which information is to be retrieved. To see this command in action, take a look at the following statement.

set FileData to ¬
     (info for file "Macintosh HD:Users:jerryford:Documents:PartsDB.txt")

Here, the info for command is being used to retrieve file information for a file named PartsDB located in Macintosh HD:Users:jerryford:Documents:. The info for command retrieves a great deal of information about the target file or folder. For example, the previous statement will return ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required