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!
on mouseUp
put the filename of this stack into fPath
set the itemDelimiter to "/"
put empty into the last item of fPath
put "WP_dist" into myVar
put (fPath &myVar) into myFolderPath
--looking at result to see if path is correct
put myFolderPath into fld "testing"
get $folderPath_wpconfig
put "/WP_dist" after it
put it into myFolder
-- checking path
put myFolder into fld testing2
-- I am sure this is where I am going wrong, tried folder, but nothing
--occurs, binfile and file product an empty document with correct title.
put url ("binfile:" & myFolderPath) into url ("binfile:" & myFolder)
end mouseUp
I can see that the binfile designation does not work, but I was just experimenting on a process that might lead me, (the blind man) to
a solution,
on mouseUp
set the itemDel to slash
put (item 1 to -2 of the effective filename of this stack) & slash & "WP_dist/" into myFolderPath
put myFolderPath into fld "testing"
put $folderPath_wpconfig & "/WP_dist/" into myFolder
set the directory to myFolderPath
put the files into myFileList
repeat for each line myFile in myFileList
put url ("binfile:" & myFolderPath & myFile) into url ("binfile:" & myFolder & myFile)
end repeat
end mouseUp
If you are copying nested folder, you will need to repeat this script recursively for every folder inside the folder you are copying.
You might also use the revCopyFolder command, but this has advantages as well as disadvantages. A shell function might be an alternative.
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode