Windows Vista Forums

Drag and Drop-How to get the url's title?, Name? Description?
  1. #1


    MarceepooNu Guest

    Drag and Drop-How to get the url's title?, Name? Description?

    I made a .Hta file that contains some drag and drop (primitive coding, alas).
    (see full .hta code at bottom of this posting)
    The .hta returns the url of links that are dragged and dropped onto it.
    But there's info it doesn't return that I need, and I don't know the right
    term to describe what I need that I'm not getting.
    To explain by example, if I open a window to this url:
    ---- http://dotcommunities.codeplex.com/
    and I open Windows Explorer to a folder
    ----- e,g, c:\apps
    and I drag the url to that folder, a shortcut file will be created.
    The shortcut file will contain the url AND the additional info I want,
    which is stored in the shortcut file's name.

    Does anyone have any suggestions how I can modify my .hta so that the
    message box also returns the info that would be shortcut file's name (except
    for the .url at the end)?

    Thanks for reading this and for your time and help.

    MarceepooNu



    --
    MarceepooNu

      My System SpecsSystem Spec

  2. #2


    MarceepooNu Guest

    RE: Drag and Drop-How to get the url's title?, Name? Description?

    whoops. I omitted the .hta code. Here it is:

    <html>
    <head>
    <title>Drag and Drop, dataTransfer.getData("URL")</title>
    <style>
    #divTarget {
    position: absolute;
    left: 50px;
    width: 200px;
    height: 200px;
    background-color: yellow}
    </style>
    <HTA:APPLICATION
    APPLICATIONNAME="Drag and Drop, dataTransfer.getData("URL")"
    ID="DragandDropDataTransferGetdata"
    VERSION="1.0"/>
    </head>

    <script language="VBScript">



    FullName = replace(DragandDropDataTransferGetdata.commandLine,chr(34),"")
    arrFN=split(FullName,"\")
    FileName = Trim(arrFN(ubound(arrFN)))
    SourceDir=replace(FullName,FileName,"")



    Sub Window_OnLoad
    'This method will be called when the application loads
    'Add your code here
    End Sub



    Sub subRarCpyThisPrgFile2Pdrv
    Dim sHtaPrgFullName
    Dim sThisHtaFullNam
    Dim sThisHtaFileName
    Dim sCmdLine
    Dim sRarCopyScriptFullName
    Dim sArgFullNameOfFil2bBakdUp
    Dim oFSO
    Const LOCAL_BACKUPDIR = "L"
    Const SVR6_BACKUPDIR = "SVR6"
    Const SCRIPT_TYPE = "VBS"

    Set oFSO = CreateObject("Scripting.FileSystemObject")

    'http://gallery.technet.microsoft.com/ScriptCenter/de-de/7a7f9937-0c6f-4f1e-a953-d29e47b2f5d5 ''''''''
    sThisHtaFullName = Trim(FullName)' "\\svr6\Data1\data\_Shtcuts\Toolbar
    links\A\A_HtaReplacment\ToolbarA_replacement.aaa.hta"

    sThisHtaFileName = Trim(oFSO.GetFileName(sThisPrgFullName))
    sThisPrgFullName = sThisHtaFullName
    If Len(sThisHtaFullName) > 5 Then
    sThisPrgFullName = sThisHtaFullName
    Else
    sThisPrgFullName = WScript.ScriptFullName
    End If

    sRarCopyScriptFullName =
    "K:\data\Programs\HtaPrgs\Vbs.RarCpyBakupSelected.file.namedArgs.aaa.vbs"
    sArgFullNameOfFil2bBakdUp = "/FulNameOfFil2bBakdUp:" & Chr(34) &
    sThisPrgFullName & Chr(34)

    ' sArgFullNameOfArcFile = "/RarArcFilPath:" & Chr(34) &
    "P:\Data\VB\HTML_MarcsPrgs\ItWorks\" '& sThisHtaFileName & Chr(34)
    sArgPathOfArcFile = "/RarArcFilPath:" & chr(34) &
    "\\svr6\D\Data\VB\HTML_MarcsPrgs\ItWorks_Hta\" & chr(34)'& _
    ' sThisHtaFileName & ".rar" & Chr(34)

    ' sCmdLine = "wscript " & Chr(34) & sRarCopyScriptFullName & Chr(34) & " " &
    sArgFullNameOfFil2bBakdUp & Chr(34) & _
    ' sThisHtaFullName & Chr(34) & " " & sArgFullNameOfArcFile
    sCmdLine = "wscript " & Chr(34) & sRarCopyScriptFullName & Chr(34) & " " &
    sArgFullNameOfFil2bBakdUp & _
    " " & sArgPathOfArcFile
    ' MsgBox sCmdline
    Set objShell = CreateObject("Wscript.Shell")
    objShell.Run sCmdline '"notepad.exe c:\scripts\test.txt"
    End Sub



    Function fnDrop
    Dim strRetVal

    strRetVal = window.event.dataTransfer.getData("URL")
    MsgBox strRetVal

    subRarCpyThisPrgFile2Pdrv

    End Function

    Function cancelEvent
    window.event.returnValue = False
    End Function



    </script>

    <body bgcolor="white">

    <h1>Drag and Drop, dataTransfer.getData("URL").</h1>

    <p>This page was copied from webreference.com. Try dragging
    <a
    href="http://webreference.com/programming/javascript/dragdropie/Example2.htm">this link</a>,
    and dropping it on the yellow box below.</p>

    <div id="divTarget"
    ondragenter="cancelEvent()"
    ondragover="cancelEvent()"
    ondrop="fnDrop()">Drop on me</div>


    <!--Add your controls here-->
    <!--{{InsertControlsHere}}-Do not remove this line-->
    </body>
    </html>
    --
    MarceepooNu


    "MarceepooNu" wrote:

    > I made a .Hta file that contains some drag and drop (primitive coding, alas).
    > (see full .hta code at bottom of this posting)
    > The .hta returns the url of links that are dragged and dropped onto it.
    > But there's info it doesn't return that I need, and I don't know the right
    > term to describe what I need that I'm not getting.
    > To explain by example, if I open a window to this url:
    > ---- http://dotcommunities.codeplex.com/
    > and I open Windows Explorer to a folder
    > ----- e,g, c:\apps
    > and I drag the url to that folder, a shortcut file will be created.
    > The shortcut file will contain the url AND the additional info I want,
    > which is stored in the shortcut file's name.
    >
    > Does anyone have any suggestions how I can modify my .hta so that the
    > message box also returns the info that would be shortcut file's name (except
    > for the .url at the end)?
    >
    > Thanks for reading this and for your time and help.
    >
    > MarceepooNu
    >
    > --
    > MarceepooNu

      My System SpecsSystem Spec

Drag and Drop-How to get the url's title?, Name? Description? problems?

Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Drag & Drop Bo Berglund Virtual PC 1 25 Aug 2008
Drag & drop adamswife Vista file management 4 05 Jul 2008
No Drag and Drop? Karen Vista mail 2 04 Feb 2007
Access denied trying to "md"? Drag & Drop is now drag, drop, OK, OK ???? Noozer Vista installation & setup 0 17 Oct 2006
Drag and drop example in WBA Ranj Avalon 0 31 Jan 2006