Drop destination path

Jan Schenkel janschenkel at yahoo.com
Fri Aug 14 04:31:45 EDT 2009


--- On Fri, 8/14/09, Tariel Gogoberidze <tariel at mac.com> wrote:

> From: Tariel Gogoberidze <tariel at mac.com>
> Subject: Re:  Drop destination path
> To: use-revolution at lists.runrev.com
> Date: Friday, August 14, 2009, 12:56 AM
> 
> > On Thu, 13 Aug 2009 05:25:57 +0200,  Jim Sims
> wrote:
> 
> 
> > 
> > You don't state if you need an OS X and Windows
> solution, but if you
> > select a folder and then run the following applescript
> you will get
> > the path (in this case it is copied to the clipboard).
> Hope it helps
> > you somehow.
> > 
> > tell application "Finder"
> >     copy selection to theSelected
> >     set outputPathList to {}
> >     repeat with anItem in theSelected
> >         copy (POSIX path
> of (anItem as alias)) to end of outputPathList
> >     end repeat
> >     set AppleScript's text item
> delimiters to return
> >     set outputString to outputPathList
> as string
> >     set AppleScript's text item
> delimiters to ""
> >     set the clipboard to outputString
> > end tell
> 
> 
> Thanks Sims, nice script, I had a simpler version.
> 
> tell application "Finder"
>   get selection
>   set curr_sel to result as alias
>   set posix_path to (POSIX path of (curr_sel) as
> string)
>   set the clipboard to posix_path
> end tell
> 
> but they both work only if folder is preselected. And yes,
> I need a windows solution as well
> 
> > On Wed, 12 Aug 2009 23:09:45 -0700,  Jim Ault
> wrote:
> 
> 
> 
> > When drag-dropping from one app to another, the first
> app does not
> > have a way of 'knowing' what object the second app has
> used to accept
> > the drop (if it accepted the drop at all).  This
> is true for any of
> > the drag-and-drop between programs that I have
> experienced in the
> > past.  The operating system does not know
> anything about the second
> > app object definitions or drop areas.  The same
> thing is true of using
> > a clipboard to move data.  The first app knows
> nothing about the paste
> > operation in the second app.
> 
> And yet, all FTP clients on Mac ("Transmit" for example)
> somehow manage to support drag and drop download to
> arbitrary folder.
> I suspect windows FTP clients can do drag / drop downloads
> to any folder of user choice as well. On Mac I would
> probably solve it eventually through AppleScript or Shell
> but I have not clue how to do this on windows.
> 
> Thanks for ideas and tips, for small group of users or
> internal use that would be great solution, but I need HIG
> compliant, "standard way"  of doing this.
> 
> I hoped that at least dragData would be able to resolve
> remote paths  with something like..
> 
> set the allowableDragActions to "link"
> Put " ftp://user:pass@server.com:21//Videos/MyVideo"
> into tRemoteFilePath
> set the dragData["file"] to tRemoteFilePath
> 
> but that doesn't seems to be a case
> 
> best regards
> Tariel
> 

You can always download the file into a temporary file, and then Windows Explorer at least will simply copy the temporary file to the target destination.
##
local sTempName
on dragStart
  put tempName() into sTempName
  put URL theRemoteURL into sTempName
  set the allowableDragActions to "copy"
  set the dragData["file"] to sTempName
end dragStart
on dragEnd
  delete file sTempName
end dragEnd
##
The problem then is that the whole file needs to be downloaded to make this happen, even if the user decides not to drop the file after all. So I don't see a clean solution either.

Jan Schenkel
=====
Quartam Reports & PDF Library for Revolution
<http://www.quartam.com>

=====
"As we grow older, we grow both wiser and more foolish at the same time."  (La Rochefoucauld)


      



More information about the use-livecode mailing list