Skip to content

Instantly share code, notes, and snippets.

View stuncloud's full-sized avatar
💭
( ‘(I¥‘)

Joey Takahashi stuncloud

💭
( ‘(I¥‘)
View GitHub Profile
@stuncloud
stuncloud / UwscHistory.md
Last active November 18, 2022 01:50
UWSC更新履歴をmarkdownで整形したもの

UWSC更新履歴

Ver5.3.0.2

  • SLCTBOX関数にて配列変数を使用した時にエラーが出るのを修正

Ver5.3.0

2017/04/18 Ver5.3.0

@stuncloud
stuncloud / settings.json
Last active May 13, 2022 05:35
winget (v1.3.1251-preview) でportableアプリとしてのuwscrをインストールするやつ
// winget settings で設定ファイルを開く
{
"$schema": "https://aka.ms/winget-settings.schema.json",
// v1.3.1251-preview で以下を設定します
"experimentalFeatures": {
"portableInstall": true
}
}
@stuncloud
stuncloud / call_from_url.uws
Last active April 29, 2022 07:08
callでURLを指定してスクリプトを読み込む
textblock msg
call url[http://example.com/hoge.uws]
のようにURLを記述することでweb上のスクリプトをcallできます
スクリプトのMIMEはtext/plainが良さそう
endtextblock
msgbox(msg)
@stuncloud
stuncloud / OCR.uws
Created September 20, 2021 10:41
UWSCでOCR
module OCR
function Get(path)
result = powershell(replace(ps1, "%filepath%", path))
fend
textblock ps1
[Windows.Media.Ocr.OcrEngine,Windows.Media.Ocr,ContentType=WindowsRuntime] | Out-Null
[Windows.Storage.StorageFile,Windows.Storage,ContentType=WindowsRuntime] | Out-Null
[Windows.Graphics.Imaging.BitmapDecoder,Windows.Graphics.Imaging,ContentType=WindowsRuntime] | Out-Null
Add-Type -AssemblyName System.Runtime.WindowsRuntime
@stuncloud
stuncloud / Cargo.toml
Last active February 22, 2022 09:27
windows-rs (0.18) でCOMオブジェクトをやる
[package]
name = "com_object"
version = "0.1.0"
authors = ["stuncloud <stuncloud+github@gmail.com>"]
edition = "2018"
[dependencies]
windows = "0.18.0"
[build-dependencies]
@stuncloud
stuncloud / Cargo.toml
Created August 17, 2021 07:09
windows-rs (0.17まで) でCOMオブジェクトをやる
[package]
name = "com_object"
version = "0.1.0"
edition = "2018"
[dependencies]
windows = "0.17.0"
[build-dependencies]
windows = "0.17.0"
@stuncloud
stuncloud / cargo.toml
Created August 5, 2021 09:27
dlopen と libffi と libc でdll関数を呼ぶ (FindWindowW, SetWindowPlacement)
[package]
name = "hoge"
version = "0.1.0"
edition = "2018"
[dependencies]
dlopen = "0.1"
libffi = "1.0.1"
libc = "0.2"
ret = doscmd("powercfg -l")
for row in split(ret, "<#CR>")
SCHEME_GUID = betweenstr(row, "GUID: ", " (")
name = betweenstr(row, " (", ")")
isDefault = length(betweenstr(row, ")")) > 0
if isDefault then
break
endif
next
@stuncloud
stuncloud / MusicPlayer.psm1
Created March 10, 2021 04:32
PowerShellで音楽を鳴らす
#Requires -Version 7.0
if (!('System.Windows.Media.MediaPlayer' -as [type])) {
Initialize-MusicPlayer
}
$Script:PlayListDir = '~\Music\PowerShell\Playlists'
if (! (Test-Path -Path $Script:PlayListDir)) {
md $Script:PlayListDir
}
@stuncloud
stuncloud / WebSocketSample.uws
Last active March 5, 2021 07:44
UWSCでWebSocket
dim hRequest, hSession, hConnection, hWebSocket, emsg
try
// セッションを作る、戻り値が0なら失敗
hSession = WinHttpOpen("UWSC WebSocket Sample", WINHTTP_ACCESS_TYPE_AUTOMATIC_PROXY, NULL, NULL, 0)
if hSession = 0 then
err = GetLastError()
emsg = "failed on WinHttpOpen (" + err + ")"
exit
endif