>▼tonboさん:
>ソリッド色変.awkを修正して任意色以外のソリッドも対応するようにしてみました。
ありがとうございます。
>▼いっちさん:
こんにちは、お世話になります。
PowerShell_Ver7.x で動作しないので、tonboさんには失礼ですが、
編集させて頂きました。
=============== ソリッド色変更.bat ==================
powershell -NoProfile -ExecutionPolicy Bypass -Command ^
Add-Type -AssemblyName System.Windows.Forms; ^
$d = New-Object System.Windows.Forms.ColorDialog; ^
$d.FullOpen = $true; ^
$sf = '%~dp0color_settings.txt'; ^
if ([System.IO.File]::Exists($sf)) { ^
$lines = [System.IO.File]::ReadAllLines($sf); ^
if ($lines.Count -ge 2) { ^
if ($lines[0]) { ^
$d.Color = [System.Drawing.ColorTranslator]::FromHtml($lines[0]) ^
}; ^
$arr = $lines[1] -split ',' ^| Foreach-Object { [Convert]::ToInt32($_, 10) }; ^
$d.CustomColors = $arr; ^
} ^
} ^
if ($d.ShowDialog() -eq [System.Windows.Forms.DialogResult]::OK) { ^
$hex = '#{0:X2}{1:X2}{2:X2}' -f $d.Color.R, $d.Color.G, $d.Color.B; ^
[System.IO.File]::WriteAllText('%~dp0color.txt', $hex); ^
$ccText = $d.CustomColors -join ','; ^
[System.IO.File]::WriteAllLines($sf, @($hex, $ccText)); ^
}
copy jwc_temp.txt temp.txt
jgawk -f ソリッド色変2.awk temp.txt > jwc_temp.txt
:pause
================================================
----------- ソリッド色変2.awk (まんま) ---------
BEGIN {
color_file = "color.txt"
if ((getline < color_file) > 0) {
hex_color = $1
}
close(color_file)
}
/^hq/ {print "hd";next}
/^s[lceog]/ {
print "lc 10 "hex_color
print $0
next
}
{print $0}
------------------------------------------------
※ 難を言うと、PowerShellの動作が遅い(自PCスペックでは^^^)
自由に突っついてみてください。