I have a script like below:
tell application "Finder"
set numOfOldEps2 to count every item of folder "Users:USER HERE:Music:iTunes:iTunes Music:Podcasts" of startup disk
display dialog numOfOldEps2
end tell
I want to know how I can get the name of the current user folder so this script can work on all computers.
Thanks
Check out the path to
command in StandardAdditions.
log (path to home folder)
log (path to home folder as Unicode text)
log (path to music folder as Unicode text)
tell application "Finder"
set numOfOldEps2 to count every item of folder (path to music folder as Unicode text) & "iTunes:iTunes Music:Podcasts:"
display dialog numOfOldEps2
end tell
Also, note that the iTunes Music folder location can be changed.