How to make home folder path universal in AppleScript?

Universal name for home folder in Applescript


In an effort to use various scripts on multiple macs, I am trying to find a way in this script that would replace users/**** with whatever would make it universal to all macs or how the script must be changed.


I assume it would work on Golden Gate as well ….though assumptions are dangerous 😀


tell application "Finder"

open POSIX file "/Users/****/Desktop/ICONS"

end tell


Thanks

iMac (2017 – 2020)

Posted on Oct 29, 2026 9:53 PM

Reply
Question marked as Top-ranking reply

Posted on Oct 30, 2026 5:12 AM

Other variations:


use scripting additions

property USER : short user name of (system info)

tell application "Finder" to open ((path to desktop) & "SVG:") as text
set afolder to "/Users/" & USER & "/Desktop/PDF"
tell application "Finder" to open folder (POSIX file afolder as alias)
tell application "Finder" to open folder ((path to home folder as text) & "Library:") as alias




4 replies
Question marked as Top-ranking reply

Oct 30, 2026 5:12 AM in response to mrokloricred37

Other variations:


use scripting additions

property USER : short user name of (system info)

tell application "Finder" to open ((path to desktop) & "SVG:") as text
set afolder to "/Users/" & USER & "/Desktop/PDF"
tell application "Finder" to open folder (POSIX file afolder as alias)
tell application "Finder" to open folder ((path to home folder as text) & "Library:") as alias




How to make home folder path universal in AppleScript?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.