Page 1 of 1

revCopyFile, revCopyFolder problems

Posted: Sat Dec 25, 2010 1:26 pm
by exheusden
I am unable to get either revCopyFile or revCopyFolder to work correctly.

revCopyFile copies nothing; revCopyFolder copies the folder, but not its contents.

I'll start with revCopyFils and maybe the solution to that will help with revCopyFolder, too.

Here is some test code:

Code: Select all

on mouseUp
   put fld "tester" into appleScriptInit
   
   put the effective filename of this stack into tPath
   set the itemDelimiter to slash
   delete last item of tPath
   put tPath & "/Required files/eBooks.css" into fileToCopy
   
   delete last item of tPath
   put tPath & "/" into folderToCopyTo
   
   revCopyFile fileToCopy, folderToCopyTo
   put "File:" && fileToCopy & "; Folder:" && folderToCopyTo
end mouseUp
The subfolder Required files and its associated files (in this case we are looking only at eBooks.css) exist. (Indeed, I can run a copy from the Terminal, but not from the Shell command).

The final put is there simply to check the variables being used.

The script compiles and runs without error. However, nothing is copied.

What am I doing wrong?

(RevMedia 4.0.0 under MacOS X 10.6.5)

Re: revCopyFile, revCopyFolder problems

Posted: Mon Dec 27, 2010 8:02 am
by WaltBrown
You have two "delete last item of tPath " lines. Was that intentional, ie, you want the copied file in the parent directory of the directory your stack is in?
Walt

Re: revCopyFile, revCopyFolder problems

Posted: Mon Dec 27, 2010 11:05 am
by exheusden
Yes, that was intentional.

RevCopyFile simply doesn't work in MacOS X, I've come to the conclusion.

I have solved my problem by using a simple Apple Script piece of code. See http://forums.runrev.com/phpBB2/viewtop ... 104#p29104

Re: revCopyFile, revCopyFolder problems

Posted: Tue Dec 28, 2010 6:55 pm
by wsamples
The conclusion that revCopyFile does not work in OS X is not supported by what I see here.

A one button application that runs a simple script with "answer file to copy", "answer destination directory" and "revCopyFile selectedfile,selectedDestination" works in both the IDE and as a standalone in 10.6.3. The standalone works in 10.6.3 whether the app is produced in OS X or in Linux.

A similar simple app which creates the destination directory instead of selecting an already existing one also works as expected.

An app made to select and then copy a file into [theApp.app]/Contents/MacOS directory of the standalone, using effective filename of this stack, etc. syntax, also successfully copies to this location for me.

With all due respect, is it not possible that you are having trouble with filepath names? Are the files and folders you're copying actually where you're telling the script to look, both working with the stack in the IDE and after you've made the standalone? Are all the various created pathnames correct; no extra slashes or misplaced quotes? Perhaps adding some mechanism to show the pathnames of all files and directories at each step of the operation, and whether or not the files to be copied are actually found in their specified locations at the time of the operation, would reveal such problems.