Drop destination path
Tariel Gogoberidze
tariel at mac.com
Fri Aug 14 03:56:54 EDT 2009
> 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
More information about the use-livecode
mailing list