From: Sean Wilson on
> But now, when I play the movie inside Director, and initiate the action to
> copy the file, nothing happens.

What does the 'alert' I added tell you?

> If I build the projector, then I get a "script
> error" message. Anyone have any thoughts on that?

As well as having the xtra available during authoring, you also need it
available to your projector. Either use the Modify -> Movie -> Xtras
dialog to include it in the projector, or create a folder alongside your
projector named "xtras" and place a copy in there.
From: Charles Simonson on
[q][i]Originally posted by: [b][b]Newsgroup User[/b][/b][/i]
What does the 'alert' I added tell you?

It now tells me "Script error: Variable used before assigned value Alert OK
?"


[q][i]Originally posted by: [b][b]Newsgroup User[/b][/b][/i]
...or create a folder alongside your projector named "xtras" and place a copy
in there.

I had the xtras in the directory with the projector, but not in a folder
called 'Xtras'. This is fixed now.

So now, with the following script, I have made some progress, in that I am
able to copy and paste the file, however, I am having directory saving issues.
I have been unable to get the file I am copying to copy to anywhere but the
main directory. If anyone has knowledge on how to copy to a different directory
that would be great, particularly copying to a flash drive ('bb' is the name of
the flash drive in the script below). Here is my code:



on mouseUp me
baCopyFileProgress(the moviePath&"480p.mov",
"/Volumes/bb/480p.mov","IfNewer", "Copying Movie to disk... ", "Cancel", 0)
end

From: Sean Wilson on
> I have been unable to get the file I am copying to copy to anywhere but the
> main directory.

Can you explain what you mean by "main directory"? Are you perhaps
referring to the root of the Flash drive, or the same directory that
your Director movie resides in?

For some reason you removed the assignment of the return code from the
copy method. That's unfortunate as it will usually contain useful
information about /why/ an operation failed if it did so.
--
on mouseUp me
OK = baCopyFileProgress(_movie.path & "480p.mov",
"/Volumes/bb/480p.mov", "IfNewer", "Copying Movie to disk...", "Cancel", 0)
alert OK
end

From: Charles Simonson on
By main directory, I mean the directory where the director project resides. I
would like to copy a movie from this directory to the root of the flash drive
directory.

I updated the code with yours, and now when I run the movie, it gives me an
error stating:
Script error: String expected
Alert OK
5

If I adjust the code so that it copies the file from the projects directory
and pastes it into the same, then the file will copy with the progress bar and
after the copy is complete it gives me the same error message as above, only
with a '0' instead of a 5.

Thank you for your continued help and support.

From: Sean Wilson on
> By main directory, I mean the directory where the director project resides. I
> would like to copy a movie from this directory to the root of the flash drive
> directory.

I'm still not understanding you. You want to copy a file from the
directory where the projector is, or a sub-directory?
If you want to copy from a sub-directory, try something like:
--
on mouseUp me
tSource = "@/movies/480p.mov"
tDest = "/Volumes/bb/480p.mov"
OK = baCopyFileProgress(tSource, tDest, "IfNewer", "Copying Movie to
disk...", "Cancel", 0)
if OK <> 0 then alert string(OK)
end

> I updated the code with yours, and now when I run the movie, it gives me an
> error stating:
> Script error: String expected
> Alert OK
> 5

My mistake. I assumed that when you use 'alert' whatever you are
alerting is auto-cast to a string. Try the above instead.

> If I adjust the code so that it copies the file from the projects directory
> and pastes it into the same, then the file will copy with the progress bar and
> after the copy is complete it gives me the same error message as above, only
> with a '0' instead of a 5.

If you look in the docs for Buddy API, 0 means the operation succeeded
and 5 means "Couldn't create directory for Dest file" (suggesting your
destination path is incorrect)
Since you already use Buddy API I suggest you use a combination of
baDiskList() and baDiskInfo(disk, "type") to determine which is your
Flash drive and then use that disk as your root for copying.
For example:
on mouseUp me
lDisks = baDiskList()
lTargets = []
repeat with aDisk in lDisks
if baDiskInfo(aDisk, "type") = "Removable" then
-- found (potential) target
lTargets.append(aDisk)
end if
end repeat
case count(lTargets) of
0: -- no removable drives available to copy to
alert "Drive not found"
1:
tSource = "@/movies/480p.mov"
tDest = lTargets[1] & "480p.mov"
me.mCopyFile(tSource, tDest)
otherwise:
-- more than one removable drive available
-- you'll need to create a routine to determine
-- which one you want to copy to, or present the user with
-- a selection they can choose from
end case
end

on mCopyFile me, aSource, aDestination
OK = baCopyFileProgress(aSource, aDestination, "IfNewer", "Copying
Movie to disk...", "Cancel", 0)
if OK <> 0 then alert string(OK)
end