Hi Pradeep,
pkmittal wrote:set the folder to specialFolderPath("engine") & slash & "TEST Data"
there is nothing wrong with this line!
You should use more parenthesis however:
set the folder to (specialFolderPath("engine") & "/TEST Data")
Sometimes the engine will only evalutae the first part of the string (before the first &), therefore parens
should be used whenever possible and it makes sense!
But as I tried to point out in anohter thread, using relative filenames after setting the defaultfolder
does obviously NOT work as exspected on mobile devices, so try to always use absolute filenames!
...
put (specialfolderpath("engine") & "/TEST Data") into tFolderInQuestion
answer (there is a folder tFolderInQuestion)
put (specialfolderpath("engine") & "/TEST Data/1.jpg") into tFileInQuestion
answer (there is a file tFileInQuestion)
## should display TRUE if you added the files and folder via the "Copy files" tab in the standalonebuilder.
...
So your desired "copy files/folders from engine to docs folder" routine should look like this:
Code: Select all
command do_the_copy
## 1. create abolute pathnames!
put (specialfolderpath("engine") & "/TEST Data") into tEngineFolderTEST
put (specialfolderpath("documents") & "/TEST Data") into tDocsFolderTEST
## 2. Check for folder and create folder if necessary
if there is not a folder tDocsFolderTEST then
create folder tDocsFolderTEST
end if
## 3. Now get the list of files in that folder:
set the folder to tEngineFolderTEST
put the files into tFiles2Copy
## 4. Now copy all the files to the docs folder in a repeat loop:
repeat with i = 1 to the num of lines of tFiles2Copy
## 5. Again: Create absolute filenames, thsi will ALWAYS work! :-)
put (tEngineFolderTEST & "/" & line i of tFiles2Copy) into tSourceFile
put (tDocsFolderTEST & "/" & line i of tFiles2Copy) into tTargetFile
## 6. Check if files are already present, optional
if there is NOT a file tTargetFile then
put url("binfile:" & tSourceFile) into url("binfle:" & tTargetFile)
end if
end repeat
end do_the_copy
Do so for every folder/file you need to copy to the docs folder to be able to modify/edit them.
Best
Klaus