ANNOUNCE: Cocoa Scripting Course #9 File Processing

I wrote new ebook about Script Bundle (in Japanese). PDF 449 pages.

https://piyomarusoft.booth.pm/items/5752216

This is the ninth book in the Cocoa Scripting series. This is a must-have for Scripters who want to use Cocoa’s functions to perform overwhelmingly fast and advanced file processing. Volumes 8 and 9 are sequel, and Volume 8 is about file path processing, and this 9 volume summarizes the actual file processing. A wide range of content from the basics of file processing to the practical level was explained in an easy-to-understand manner.

Anyone who has mastered AppleScript should use Cocoa Scripting without fail. And the biggest reason for this can be said to be this file processing (high speed & high functionality).

Anyone who has mastered AppleScript should use Cocoa Scripting without fail. And the biggest reason for this can be said to be this file processing (high speed & high functionality).

table of contents

Chapter 1: Introduction
Chapter 2 Practice
Chapter 3 File Manipulation Basics
■Basic knowledge of file handling
File path-related terminology
Fundamentals of File Handling
Differences between AppleScript and Cocoa path representation
About the file handling AppleScript in this document

■Retrieving File/Folder Names
Retrieving the file name
Retrieving Folder Names

■Check for the existence of a file/folder
Check for the existence of a file/folder
Check for the existence of the folder (+ create it if it does not exist)

■Rename (rename) a file/folder
Rename file names
Rename Folder Names
Names that cannot be renamed

■Copying Files/Folders
Copying files
Copying a Folder

■Moving Files/Folders
Moving files
Moving a Folder
Moving files (with creating new folders)
Moving a folder (with creating a new folder)

■Deleting Files/Folders
Delete files/folders (move to trash)
Deleting Files/Folders

Chapter 4 File Manipulation Practice

■Reading the contents of a file
Importing a file by specifying a character encoding
Automatically detect and read character encoding (1)…(3)

■File Writing
Write a file with a specified character code (1)…(3)

■File Comparison
Comparing two files
Comparing the contents of two text files

■Handling Finder Labels
Finder labels and tags
About Finder Labels
Get the label of a file
Clear a file’s label
Set a label for a file
Get Label Designation
Get localized label names in the specified language
Filter by label INDEX
Filter by label INDEX (Spotlight)

■Handling Finder Tags
About Finder Tags
Get tags
Clear Tags
Set up tags
Add tags
Get the INDEX value from the tag name

■Changing the attribute information of a file/folder
Changing the date and time of file creation or modification
Change the creation date and time of the file (dialog selection)
Changing the creation date and time of a folder
Changing the Folder Creation Date and Time (Dialog Selection)
Change the creation date of JPEG images based on EXIF information (1)…(2)
Change the creation/modification date of Script documents under the specified folder.

■Retrieving files in a folder
Get list of file paths/file names
Get list of file paths + sort by file name
Get list of file paths + sort by modification date
Get the file with the name containing the specified string (1)…(2)
Get the file path of the extension in the extension list
Get the file name of the extension in the extension list
Get file path belonging to the specified UTI (1)…(2)

■Rename with filename collision avoidance
Specify a new name and rename while avoiding name collisions (1)…(2)
Confirmation of the existence of the specified path + renaming
Folder Existence Confirmation + Folder Confirmation + Rename
Confirmation of file existence + collision avoidance + addition of child number
Batch renaming of a large number of files in a folder (1)…(5)

Chapter 5 Miscellaneous File Handling

:white_medium_small_square:Spotlight file search using Metadata Lib
Spotlight search under the specified folder (1)…(8)

:white_medium_small_square:File search with NSFileManager
Retrieving File Paths with NSFileManager
Retrieving File Paths with NSFileManager + Extracting by Extension

:white_medium_small_square: Setting a custom icon for a file/folder
Get and set the icon of the specified file
Deleting a custom icon for a specified file
Get and set the icon of the specified folder
Deleting Custom Icons for Specified Folders

:white_medium_small_square: File encryption/decryption
Encrypt and decrypt strings with FBEncryptor

:white_medium_small_square:Retrieving information about Zip archives
Notes on ZIP-related open source programs
Retrieving file information during archiving (ZipZap)
Retrieving file information during archiving (SevenZip)
Retrieving file information during archiving (ZipZap) (1) (2)
Confirm archive password settings (ZipArchive)
Password verification for archives (ZipArchive)

:white_medium_small_square:Create/Extract Zip Archives
Create a Zip archive from a file (ZipArchive)
Creating a Zip archive from a folder (ZipArchive)
Creating a Zip archive from a folder (ZipArchive)
Create a Zip archive from a file (ditto)
Create a Zip archive for each folder structure (ditto)
Extracting a Zip archive
Compress/decompress NSData

:white_medium_small_square: Calculating the checksum or hash value of a file
Compute the MD5/SHA1/SHA512 hash value of the file (md5Lib)
Calculate the MD5 hash value of NSData
Image judgment based on hash value (1)… (3)

Attached Script Introduction

Data

AppleScript instructions related to Cocoa Scripting
Cocoa Scripting and Script Objects
AppleScript Droplet
Calling third-party frameworks and AppleScript Libraries
AppleScript mini reference
AppleScript Runtime Environments and Related Tools
List of AppleScript Reserved Words
Error Code Table

Assessment Assessment
Afterword, colophon