Beckey B Beckey B - 4 months ago 6
AppleScript Question

Remove text from a returned string through applescript

I am using the following to find the home folder on a Mac


get path to home folder


and it returns the following string...


alias "Macintosh HD:Users:Office2-Spare:"


All I need is the information between the quotes. Is there way of pulling that out or deleting the word alias, the space and the quotes?

I have trawled the net but only found ways of trimming text from the end. Can anyone help?

Thanks :)

Answer

alias is not really part of the response, it's telling you the data type. You just need to tell it what data type you want.

Set thePath to (get path to home folder) as string
Comments