AppleScript Tutorial : Alias, HFS & POSIX - OH MY!

Published: 06 January 2022
on channel: ClickingKeys
2,854
118

Learn how to AppleScript, Apple's built in automation platform. In this video we'll dig deeper into file references, file aliases, HFS file paths and POSIX file paths. You'll see what the differences are as well as how to convert from one form to another.

HFS = Hierarchical File System, Apple's file system
POSIX = Portable Operating System Interface, Unix based file path



-- -- -- -- -- -- -- START EXAMPLE SCRIPT CODE -- -- -- -- -- -- --
on run
set posixPath to "/Users/clickingkeys/Desktop/Demo_1.jpg" # EXAMPLE OF A POSIX PATH
log "Example POSIX path"
log posixPath

set hfsFilePath to POSIX file posixPath # CONVERTS A POSIX PATH TO AN HFS FILE REFERENCE
log "Example HFS file reference"
log hfsFilePath

set hfsPath to POSIX file posixPath as string # CONVERTS A POSIX PATH TO AN HFS FILE PATH
log "Example HFS path"
log hfsPath

set aliasExample to hfsPath as alias
log "Example Alias"
log aliasExample

set backToPosix to POSIX path of hfsPath # THIS WILL CONVERT AN HFS PATH TO A POSIX PATH
log "Example POSIX path 2"
log backToPosix
end run
-- -- -- -- -- -- -- END EXAMPLE SCRIPT CODE -- -- -- -- -- -- --



For more AppleScript tutorial videos, check out this play list.
   • Learn to AppleScript (for beginners/noobs)  

If you're interested in watching full scripts being written, have a look at this play list.
   • AppleScript Project Examples  


On this page of the site you can watch the video online AppleScript Tutorial : Alias, HFS & POSIX - OH MY! with a duration of hours minute second in good quality, which was uploaded by the user ClickingKeys 06 January 2022, share the link with friends and acquaintances, this video has already been watched 2,854 times on youtube and it was liked by 118 viewers. Enjoy your viewing!