I just came to this myself before coming back here
put item -1 of pURL into tFile
put item 1 to -2 of pURL into tFolder
put tDF &"/" & tFolder into tCompletePath
# loop to create sub folders
# Of course we know tDF exists,
# but we don't know about any folder after that
repeat for each item x in tFolder
put "/" & x after tNextFolder
put tDF & tNextFolder into tSubFolder
if there is not a folder tSubFolder then
create folder tSubFolder
put the result
end if
end repeat
return tCompletePath &"/" & tFile
but your function is better
BR
On 8/7/17, 8:41 AM, "use-livecode on behalf of Tore Nilsen via use-livecode"
<[email protected] on behalf of
[email protected]> wrote:
Since we do not need to check whether a folder exists or not before
creating it as LiveCode will not create duplicate folders, here is a script
that will create nested folders:
on mouseUp
put specialFolderPath("desktop")& "/testFolder/testOne/test/result"
into tFolder
set the itemDel to "/"
repeat with i = 1 to the number of items of tFolder
put item 1 to i of tFolder into tFolderToCreate
create folder tFolderToCreate
end repeat
end mouseUp
Regards
Tore
_______________________________________________
use-livecode mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode