Creating a folder using get specialFolderPath

Mark Wieder mwieder at ahsoftware.net
Mon Aug 9 12:18:52 EDT 2010


charles61-

Monday, August 9, 2010, 9:08:08 AM, you wrote:


> I have the following handler that creates a text file (list) on the user's
> application support folder on OS X:

>  if the platform = "MacOS" then
>       get specialFolderPath("home") & specialFolderPath("asup") &"/" &
> "list"
>       put it into tfilePath
>  end if

> I tried the following to create a folder in the user's application support
> folder that would store the text file (list):

> if the platform = "MacOS" then
>       get specialFolderPath("home") & specialFolderPath("asup") &"/" &
> "Student Report" & "/" & "list"
>       put it into tfilePath
>  end if

> But it does not work? Any suggestions?

If the "Student Report" folder doesn't already exist then it won't be
created automatically. Try this:

if the platform = "MacOS" then
      put specialFolderPath("home") & specialFolderPath("asup") &"/" &
"Student Report" into tfilePath
      if there is no folder tfilePath then
          create folder tfilePath
      end if
      put "/" & "list" after tfilePath
 end if

-- 
-Mark Wieder
 mwieder at ahsoftware.net




More information about the use-livecode mailing list