-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding ClipBoard History WorkAround For File Renaming
- Loading branch information
Kyle Condon
committed
Nov 6, 2023
1 parent
543acdb
commit 78a1f4b
Showing
20 changed files
with
72 additions
and
26 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
13 changes: 13 additions & 0 deletions
13
KPC/Clipboard/Rename Selected OC File From Clipboard History
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#PS | ||
$OCPath = (Get-Process OneCommander).Path | ||
if ($OCPath.Contains('WindowsApp')) { | ||
$ParseOCPath = (Join-Path $Env:USERPROFILE '\OneCommander\') | ||
} | ||
elseif ($OCPath.Contains('Program Files')) { | ||
$ParseOCPath = (Join-Path $Env:LOCALAPPDATA '\OneCommander\') | ||
} | ||
else { | ||
$ParseOCPath = (Get-Item -LiteralPath $OCPath).Directory.FullName | ||
} | ||
& (Join-Path $ParseOCPath 'Resources\KPC\Set-OCVariables.ps1') -CurrentDir $CurrentDir -SelMultiple $SelectedFiles -OpDir $OpDir | ||
& pwsh -File (Join-Path $ParseOCPath 'Resources\KPC\Invoke-PasteFromClipBoardHistory.ps1') |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
Add-Type -AssemblyName System.Windows.Forms | ||
Add-type -AssemblyName System.Drawing | ||
powershell.exe -NoProfile -File "$PSScriptRoot\Get-CurrentClipBoardHistory.ps1" | ||
$ClipHistList = Import-Clixml -Path "$PSScriptRoot\Export\ClipHist.xml" | ||
$OCVars = Import-Clixml -Path "$PSScriptRoot\Export\Vars.xml" | ||
$SelectedFile = $OCVars.SelectedFiles | ||
$ClipHistForm = New-Object System.Windows.Forms.Form | ||
$ClipHistForm.AutoSize = $true | ||
$ClipHistForm.StartPosition = "CenterScreen" | ||
$ClipHistForm.Margin = 50 | ||
|
||
$ListBox = New-Object System.Windows.Forms.ListBox | ||
$ListBox.Size = New-Object System.Drawing.Size(800,800) | ||
foreach ($ClipItem in $ClipHistList) { | ||
if ($null -ne $ClipItem -and $ClipItem -ne "") { | ||
if ($ClipItem.Length -gt 800) { | ||
$ListBox.Items.Add(("$($ClipItem.Substring(0,100))" + "...")) | ||
} | ||
else { | ||
$ListBox.Items.Add($ClipItem) | ||
} | ||
} | ||
} | ||
|
||
$PasteButton = New-Object System.Windows.Forms.Button | ||
$PasteButton.Text = "Paste!" | ||
$PasteButton.Size = New-Object System.Drawing.Size(100,50) | ||
$PasteButton.Location= New-Object System.Drawing.Size(300,900) | ||
$PBSB = { | ||
$SelectedClipHistItem = $ListBox.SelectedItem.ToString() | ||
$OCSP = Start-Process -PassThru -FilePath (Get-Command OneCommander).Path -ArgumentList "-filePath $SelectedFile" | ||
$OCPID = $OCSP.MainWindowHandle | ||
$wshell = New-Object -ComObject wscript.shell; | ||
$wshell.AppActivate("$OCPID") | ||
Start-Sleep 1 | ||
$wshell.SendKeys("{F2}") | ||
Start-Sleep 1 | ||
$wshell.SendKeys("$SelectedClipHistItem") | ||
$ClipHistForm.Close() | ||
|
||
} | ||
$PasteButton.Add_Click($PBSB) | ||
|
||
|
||
$ClipHistForm.Controls.Add($ListBox) | ||
$ClipHistForm.Controls.Add($PasteButton) | ||
|
||
$ClipHistForm.ShowDialog() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
[1106/134306.819:ERROR:registration_protocol_win.cc(107)] CreateFile: The system cannot find the file specified. (0x2) |