Table of Contents

What's XFile ?

Requirements

How to Display Help

Install

History

License
Donation

Kurita Tetsuro
scriptfactory@mac.com

Script factory

Read Me First

What's XFile ?

XFile provides unified object oriented interface to file operation (moving, removing, geting attributes and so on).

Functions of file operations of AppleScript world is given by Scrpting Additions, Finder, System Events, shell commnads and Cocoa thru AppleScriptObjC. It is cumbersome to find a proper way, because implemeted locations of functions are distributed. XFile wraps these components and introduces a file object for unified object oriented interface.

Requirements

System

  • OS X 10.9 or later
    • Developed and tested on macOS 10.14.6

Depending Libraries

Required to install with XFile .

How to Display Help

The manual consisted of the reference generated by AppleScriptDoc and sample code is stored in the bundle of "XFile.scptd". After installation of OpenHelpBook.scptd, run "XFile" from Script menu.

The detail manual of "XFile" should be displayed in Help Viewer.

Install

Copy XFile.scptd into either following locations.

Your Home/Library/Script Libraries/

or

/Library/Script Libraries/

History

  • 1.8.4 -- 2020-04-17
    • Added is_executable().
  • 1.8.3 -- 2020-03-18
    • Fixed : a XFile instance did not follow the destination after a file is moved with move_with_replacing.
  • 1.8.2 -- 2020-02-26
    • Use NSFileManager for list_children() instead of scripting additions's list folder command.
  • 1.8.1 -- 2020-02-05
    • Added copy_with_replacing
    • copy_to is reimplemented using NSFileMangaer.
    • copy_to don't replace a copy destination.
    • is_folder returns ture for disks.
    • Fixed error of move_with_replacing.
  • 1.8 -- 2020-02-04
    • resolve_alias is reimplemented using NSURL.
    • remove, move_to, move_with_replacing, into_trash are reimplemented using NSFileManager.
    • Fixed is_package()
    • PathInfo 1.3.1 or later is required.
  • 1.7.2 -- 2020-02-03
    • Added type_identifier()
    • is_folder, is_alias, is_symlink, is_package are reimplemented using type_ideintifier().
    • Fixed the problems of into_trash() due to alias values in macOS 10.14 don't follow changing location.
  • 1.7.1 -- 2020-01-28
    • Use OpenHelpBook.scptd instead of HelpBook.osax.
    • Fixed the problems of move_to() due to alias values in macOS 10.14 don't follow changing name and location.
  • 1.7 -- 2017-04-14
    • Enabled to work with AppleScript Libraries.
    • Removed dependency on ModuleLoader.
    • OS X 10.9 or later is required.
    • Updated the help book.
  • 1.6 -- 2015-09-04
    • Added "move_with_replacing".
    • Added "volume_name".
  • 1.5 -- 2012-06-01
    • Added "info_with_size".
    • Added "perform_shell".
    • Added "shell_test"
    • Added "is_symlink"
    • The file infomation returned from "info" will not contain size infomation.
    • "resolve_alias" can follow the origianl of symbolics.
    • Improved perfomance of "copy_to" and "copy_with_opts".
  • 1.4 -- 2012-05-26
    • Added "normalized_posix_path".
    • Added "item_exists_without_update".
    • Added "each".
  • 1.3.3 -- 2011-02-10
    • Fixed resolve_alias().
    • Fixed is_folder(). Use a result of info for command.
  • 1.3.2 -- 2010-09-09
    • Refixed unique_child() for a name without including path extenstion.
  • 1.3.1 -- 2010-06-16
    • Fixed unique_child() for the instance created from a HFS path.
    • Fixed unique_child() for a name without including path extenstion.
  • 1.3 -- 2010-03-25
    • ModuleLoader is needed to load XFile.
    • Using PathInfo instead of PathAnalyzer.
    • Removed dependency on ShowHelpBook.
    • make_with() accepts POSIX pathes.
    • Added make_with_pathinfo().
    • Removed make_with_record().
    • Removed folder_name.
    • A POSX path must be passed to child(), make_folder(), make_path() instead of a HFS path.
    • Added copy_with_opts().
    • copy_to and copy_with_opts can accept a relative path as a destination.
    • Added as_furl().
    • make_path() have an argument.
  • 1.2.2 -- 2009-11-09
    • remove() will return a reviever instance.
    • copy_to will preserve file attirbutes(e.g. modification/creation date, etc).
  • 1.2.1 -- 2009-03-09
    • Fix Japanese manual can't displayed in Help Viewer.
  • 1.2 -- 2009-02-18
    • Improve unique_child() in Mac OS X 10.5
    • Remove dependency on UniqueNamer.
  • 1.1.2 -- 2009-01-29
    • item_exists() cause to reconstruct the inner file reference of alias class.
  • 1.1.1 -- 2008-11-03
    • item_exists() always access filesystem to check existantce.
    • Improve compatibility with Mac OS X 10.5 with PathAnalyzer 1.7.1.
  • 1.1 -- 2008-03-20
    • reimplement move_to method using mv command.
    • move_to method returns a boolean value.
    • fix mistakes in the manual.
  • 1.0 -- 2007.08.15
    • First release