Creating a folder using get specialFolderPath

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Creating a folder using get specialFolderPath

charles61
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?
Reply | Threaded
Open this post in threaded view
|

Re: Creating a folder using get specialFolderPath

mwieder
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
 [hidden email]

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
--
 Mark Wieder
 ahsoftware@gmail.com
Reply | Threaded
Open this post in threaded view
|

Re: Creating a folder using get specialFolderPath

xtalkprogrammer
In reply to this post by charles61
Hi,

It is not entirely clear to me what you want. Why exactly did you choose to glue specialFolderPath("home") and specialFolderPath("asup") together? Have you actually checked what the two return?

Also, you might need to check that folders actually exist. If they don't exist, create them.

set the itemdel to slash
repeat with x = 2 to number of items of myPath
        if not (there is a folder (item 1 to x of myPath)) then
                create folder (item 1 to x of myPath)
        end if
end repeat

Use the above repeat loop with folder paths only. Temporarily remove the file name from the path if necessary.

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
KvK: 50277553

From 15th August, we'll have time for new projects! Be the first in line and contact me now!

Download the Installer Maker plugin for Runtime Revolution at http://qurl.tk/ce

On 9 aug 2010, at 18:08, charles61 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?

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Kind regards,

Drs. Mark Schonewille

Economy-x-Talk Consultancy and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
Facebook: http://facebook.com/LiveCode.Beginner
KvK: 50277553