Getting the name for a Mac Users 'home'

Sarah Reichelt sarah.reichelt at gmail.com
Fri Apr 24 18:11:00 EDT 2009


On Sat, Apr 25, 2009 at 1:28 AM, Adrian Williams <adrian at clubtype.co.uk> wrote:
> Hello all,
>
> Installing fonts into the Public domain is a breeze:
> MacHD/Library/Fonts/MyNewFont.ttf
>
> But I need to install and uninstall fonts in the Users domain. For example:
> MacHD/Users/someunknownname/Library/Fonts/MyNewFont.ttf
>
> How can I retrieve 'someunknownname' from any computer and place it in a
> variable in the pathname?

$USER gives you the name of the current user.
However specialFolderPath() might provide the exact folder path you
need. As well as the docs, check out Ken Ray's list of usable codes
for this: <http://www.sonsothunder.com/devres/revolution/tips/file010.htm>

BTW, in OS X & Rev, you don't need to include the MacHD part in your
file path. /Users/username/Library.... is the way such folders are
specified.

Cheers,
Sarah



More information about the use-livecode mailing list