Community
    • Login

    open selected file

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    4 Posts 2 Posters 2.3k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • kfondaK
      kfonda
      last edited by

      Hi all.
      I have set a function key on my windows 7 machine to start Notepad++. Works as expected.
      I would like to find a way to use that key to open Notepad++ with the currently selected file from explorer.
      What I’m looking to do is select a file in explorer, hit the function key, and have the file open in Notepad++. I just can’t figure out what to pass on the command line for the selected file.
      Any ideas?

      Thanks in advance for any ideas,
      Kevin Fonda

      Claudia FrankC 1 Reply Last reply Reply Quote 0
      • Claudia FrankC
        Claudia Frank @kfonda
        last edited by

        @kfonda

        without knowing how you did it exactly, a common practice for explorer or registry tweaks is to
        use the %1 as a variable which gets replaced by the complete filename.

        Cheers
        Claudia

        kfondaK 1 Reply Last reply Reply Quote 0
        • kfondaK
          kfonda @Claudia Frank
          last edited by

          @Claudia-Frank

          What I did was to use the Logitech SetPoint software to set the function key to ‘Launch a Program’. I set the program to launch to
          “C:\Program Files (x86)\Notepad++\notepad++.exe” “%1”
          It looks like the command line doesn’t see a selected file as ‘%1’.
          I guess what I need is a way to access the name of the currently selected file from the command line.

          Claudia FrankC 1 Reply Last reply Reply Quote 0
          • Claudia FrankC
            Claudia Frank @kfonda
            last edited by

            @kfonda

            What I did was to use the Logitech SetPoint software to set the function key to ‘Launch a Program’

            OK, I guess this doesn’t work as long as the SetPoint program hasn’t a functionality to communicate with explorer/shell objects.

            I guess what I need is a way to access the name of the currently selected file from the command line.

            I didn’t use it myself but maybe AutoIt (or similar sw) might be helpful in such a case.
            Afaik AutoIt has the possibility to work with COM objects, if so it should be possible
            to get the running explorer and shell instance and get the selected file.

            Cheers
            Claudia

            1 Reply Last reply Reply Quote 0
            • First post
              Last post
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors