I'm trying to build a function where I draw a standalone into a text field to copy it to a predetermined location on the hard drive.
Once there, I want to open it from the same application, but I can not make it work. What am I doing wrong?, is it not possible to handle standalones in this way?
Grateful for any help
on mouseDown
set the dragaction to copy
end mouseDown
on dragDrop
if "Pro-Cell" is in the dragdata
then
put the dragdata into thePath
if the platform is "MacOS"
then
set the itemdel to "/"
end if
if the platform is "Win32"
then
set the itemdel to "\"
end if
put item -1 of thePath into myFile
set the defaultFolder to specialFolderPath ("temporary")
put the defaultFolder into tempFolder
put "/" & "Pro-Cell" after tempFolder
if there is no folder tempFolder
then
create folder tempFolder
end if
load url thePath
replace ".app" with empty in myFile
put tempfolder & "/" & myFile into theNewPath
put url ("binfile:" & thePath) into url ("binfile:" & theNewPath)
launch theNewPath
else
beep
end if
end dragDrop
/// Peter
Drag & drop for copying standalone
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 136
- Joined: Fri Oct 14, 2011 6:53 am
Drag & drop for copying standalone
/*Whats all the fuss with c# ?*/
Re: Drag & drop for copying standalone
Hi Peter,
here a couple of hints:
1. No need to differ between Mac and Win here!
LC uses the Unix SLASH as path delimiter internally on ALL platforms!
2. "the dragdata" is an ARRAY!
Check -> the dragdata["files"]
3. "load url xyz" will only work with (from the dictionary) -> Any valid http or ftp URL.
4.
will not work, use:
5. and most important!
Mac apps are actually FOLDERS, so this will not work on a Mac at all!
Use SHELL with "ditto" on a Mac or "revCopyFolder".
Best
Klaus
here a couple of hints:
1. No need to differ between Mac and Win here!
LC uses the Unix SLASH as path delimiter internally on ALL platforms!
2. "the dragdata" is an ARRAY!
Check -> the dragdata["files"]
3. "load url xyz" will only work with (from the dictionary) -> Any valid http or ftp URL.
4.
Code: Select all
on mouseDown
set the dragaction to copy
end mouseDown
Code: Select all
on dragenter
set the dragaction to "copy"
end dragenter
Mac apps are actually FOLDERS, so this will not work on a Mac at all!
Use SHELL with "ditto" on a Mac or "revCopyFolder".
Best
Klaus