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!
Hi.
I am a total beginner and trying to make a little stack that copies a wav file from one location to a user selected folder. I've gotten it to work between preset folders, as per the script below, but not sure how to get the file to copy to a user selected path.
On mouseUp
if the label of me is "Copy" then
answer folder "Please select a location to save to."
if it is not empty then
revCopyFile "C:\ring.wav","D:\Temp"
end if
else
pass mouseUp
end if
end mouseUp
I know this is very basic stuff but would greatly appreciete any help
On mouseUp
if the label of me is "Copy" then
answer folder "Please select a location to save to."
if it is empty then exit mouseUp -- the user has cancelled out
-- it now contains the path to a folder, it is a good idea to put it into a variable
-- because it is changing so often that one tends to forget, so as soon as you
-- fill it put it into something else
put it into tDestinationFolder
revCopyFile "C:\ring.wav",tDestinationFolder
else
pass mouseUp
end if
end mouseUp
Thank you so much!!! It worked perfectly.
I really appreciate your help Bernard. God know's I've helped many people on forums in the past and you are proof that what comes around goes around.
Cheers
Bide
Last edited by bidgeeman on Fri May 15, 2009 3:09 am, edited 1 time in total.
On mouseUp
if the label of me is "Copy" then
answer folder "Please select a location to save to."
if it is empty then exit mouseUp
put it into tDestinationFolder
revCopyFile "4x4.wav",tDestinationFolder
else
pass mouseUp
end if
end mouseUp
on mouseUp
answer file "Select the file to copy"
if it is empty exit mouseUp
put it into myFileToCopy
-- more code
revCopyFile myFileToCopy,tDestinationFolder
-- more code
end mouseUp
just indicating the file only works for the defaultFolder, which is usually in the Rev folder in the program folder. If you set the defaultfolder by going:
answer folder "Select the folder of Origin"
put it into myNewDefault
set the defaultFolder to myNewDefault
than you can just refer to the files in this folder by their names. Rev adds the path.
And once you set the defaultFolder to the folder you want you can than tell Rev
Rev puts the name of every file into the variable tAllFilesOfmyDefaultFolder.
You probably know all this but I explained it in a little more detail because when I started with Rev I had to come to grips with Rev's concept of the default folder.