Flow-Launcher / Flow-Launcher/Flow.Launcher
Add "Copy Target Path" to Programs plugin
- Dominant language
- C#
- Stars
- 15.6k
- Forks
- 644
- Avg merge
- 16h 51m
- Merged PRs (30d)
- 3
Description
**Is your feature request related to a problem? Please describe.**
Add *Copy Full Target Path* to the Program Runner Context menu, underneath the **Open Target Path**
**Describe the solution you'd like**
To copy the full path to an executable from the flow launcher box.
Could be helpful and quick for copying paths to applications to be used in scripting\automation apps such as AutoHotkey etc.
**Describe alternatives you've considered**
As I'm typing this out I'm just now realizing its kind of already possible to do this via the Explorer's Plugin Context Menu using the **Copy Path** option.
I've overlooked this till now because I almost never use flow to explorer my files `[*there are way to many with 9hdd in my computer*], thou I use the launcher ALLLL DAY! I never have to use windows start menu anymore 😄 ❤️ .
a quick example using *MusicBee* from the launcher...

and then musicbee from the Explorer... I also get all these extra entries via explorer

but using the **copy path** give me what I need to paste into a script without jumping around in my File explorer, Directory Opus.
e.g. `C:\Program Files (x86)\MusicBee\MusicBee.exe`

**Additional context**
I'm not sure of the code differences thou I use this snippet of code from [Directory Opus](https://resource.dopus.com/t/script-command-for-copying-shortcut-lnk-targets-including-arguments/51593/2). I have this VBScript function attached its context menu when I right-click on any `.lnk` file. It shows up as.. *Copy Shortcuts Full Target Path* on both File or Directory Shortcuts.
```VBScript
'Version: 1.0.1 - 7/1/24
Option Explicit
Function OnClick(ByRef clickData)
Dim WShell, fs, selectedItems, item, path, fExt, oSHLink, targetPath, arguments, resolvedPaths, itemIndex
Set WShell = CreateObject("WScript.Shell")
Set fs = CreateObject("Scripting.FileSystemObject")
resolvedPaths = ""
Set selectedItems = clickData.func.sourcetab.selected
If selectedItems.count = 0 Then
DOpus.Output "No files selected."
Exit Function
End If
itemIndex = 0
For Each item In selectedItems
If itemIndex > 0 Then
' Add newline character for each subsequent item added
resolvedPaths = resolvedPaths & vbCrLf
End If
path = item.realpath
fExt = fs.GetExtensionName(path)
If UCase(fExt) = "LNK" Then
Set oSHLink = WShell.CreateShortcut(path)
targetPath = oSHLink.TargetPath
arguments = oSHLink.Arguments
resolvedPaths = resolvedPaths & targetPath & " " & arguments
Else
resolvedPaths = resolvedPaths & path
End If
itemIndex = itemIndex + 1
Next
' Copy the resolved paths to the clipboard
DOpus.SetClip resolvedPaths
Set oSHLink = Nothing
Set fs = Nothing
Set WShell = Nothing
End Function
'// https://resource.dopus.com/t/script-command-for-copying-shortcut-lnk-targets-including-arguments/51593/2
```
Thanks
Xavier
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.