FileLib – File Routines Library
FileLib
FileLib is a free AppleScript library of essential folder and file routines for use in AppleScript scripts and applications.
FileLib Handlers
- WriteToFile ( _data , _filename , _append ) – Write data to filename and either overwrites the filename or append the data to it.
- ReadFromFile ( _filename , _delimiter ) – Read from the filename up to the delimiter character passed. Reads in whole file if delimiter is null.
- UniqueFileName ( _path , _name , _extension , _delimiters ) – Returns a unique file name. A sequential number, surrounding by the characters in delimiters list, is appended to the end the name. Delimiters default to { “_” , “” } if null. E.g., “Untitled_1.pdf”, “Untitled_2.pdf”, “Untitled_3.pdf”, etc.
- DeleteFile ( _path , _filename ) – Deletes the file.
- TestExists ( _path , _type ) – Use “test” shell script command to test for either a directory (type = “d”) or file (type = “f”). Returns true if it exists and false if it doesn’t.
- FolderExists ( _path ) – Use Finder to test whether a folder or directory exists. Returns true if it exists and false if it doesn’t.
- FileExists ( _path ) – Use Finder to test whether a file exists. Returns true if it exists and false if it doesn’t.
Free AppleScript Library
FileLib Library Code: Copy the selected code (click on Select All to highlight all the code) to the clipboard and paste it into a newly created Custom Function. Download code as a text file from here.
Comments
FileLib – File Routines Library — No Comments
HTML tags allowed in your comment: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>