Stupid Newbie q about creating folder on Mac

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
2Phat
Posts: 3
Joined: Tue Mar 30, 2010 11:20 am

Stupid Newbie q about creating folder on Mac

Post by 2Phat » Tue Mar 30, 2010 11:35 am

Hi All
I am new...
On a Mac
I am trying to create a folder in my Home folder that is derived from a field value and cannot get it right.
the folder's name should be:
$HOME/field "Date"/field "Artist"

I tried 100's of ways and cannot get it right -

Many thanks
Stef

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Stupid Newbie q about creating folder on Mac

Post by Klaus » Tue Mar 30, 2010 11:41 am

Hi Stef,

there are two ways :)
The trick is to create the correct path from the string first!

1. The longer one:
...
put $HOME into tHome
put fld "Date" into tDate
put fld "Artist" into tArtist
create folder (tHome & "/" & tDate & "/" & tArtist)
...

2. The shorter but less readable one:
...
create folder ($HOME & "/" & fld "Date" & "/" & fld "Artist")
...

Best from germany

Klaus

Post Reply