Skip to content

Instantly share code, notes, and snippets.

View emisjerry's full-sized avatar

emisjerry emisjerry

View GitHub Profile
; conv.ahk有兩種模式
; 1. conv.ahk 輸入路徑檔名 輸出路徑檔名
; 必須含有資料夾,否則會出錯
; 2. conv.ahk 輸入路徑檔名有星號 輸出副檔名
; 將輸入資料夾裡符合的檔案轉換成輸出副檔名格式
iParamCount := A_Args.Length()
if (iParamCount <> 2) {
MsgBox 命令:conv.ahk 輸入檔名 輸出檔名`n   conv.ahk 有萬用字元的檔名 輸出副檔名`n`n請重新執行。`n
Exit 1
; Generated by AutoGUI 2.5.7
#SingleInstance Force
#NoEnv
#Include d:\util\AutoGUI\convertFile.ahk
SetWorkingDir %A_ScriptDir%
SetBatchLines -1
global aFiles, sInputFolder
aFiles := []
convertFile(sInputFilename, sOutputFilename) {
WD := ComObjCreate("Word.Application") ; Create Word object
WD.Documents.Open(sInputFilename) ;open this file
WD.visible:=0 ;make visible for this example. Normally set to zero
iOutputFormat := getDocFormat(sOutputFilename)
if (iOutputFormat = -1) {
Return
}
;MsgBox format=%iOutputFormat%
/*
======================================================
InstantHotstring.ahk by Jack Dunning—April 23, 2019
======================================================
The InstantHotstring.ahk script saves newly created Hotstrings in a
DropDownList GUI control. When setting a Hotstring, AutoHotkey
immediately activates it and adds it to the DropDownList. You can
deactivate/activate Hotstrings using the Toggle Hotstring On/Off
button. The GUI window includes an Edit GUI control Hotstring Test
#SingleInstance Force
#include d:\util\autohotkey\WinClipAPI.ahk
#include d:\util\autohotkey\WinClip.ahk
^+g::
current_clipboard = %Clipboard% ; 把目前的剪貼簿內容存起來供後面還原
Send ^c ; 把選取字串用〔Ctrl+C〕存入剪貼簿
ClipWait,1
; 下行使用Google執行搜尋動作,要搜尋的字串就是剪貼簿內容
#SingleInstance Force
#include d:\util\autohotkey\WinClipAPI.ahk
#include d:\util\autohotkey\WinClip.ahk
^t::
wc := new WinClip()
wc.iCopy() ; clear current inner buffer then send Ctrl+c
_sSearch := wc.iGetText()
translate(_sSearch)
Return
#SingleInstance Force
#include d:\util\autohotkey\WinClipAPI.ahk
#include d:\util\autohotkey\WinClip.ahk
;; C:\Windows should change to %A_WinDir% for better compatibility.
;; r=rectangle 矩形剪取
^+4::
run, "%A_WinDir%\system32\SnippingTool.exe"
Sleep, 500
;; 列出Excel.Application能使用的顏色碼
;ComObjError(false) ; Disable COM Object error notification
excelApp := ComObjCreate("Excel.Application")
workBook := excelApp.Workbooks.Add
excelApp.Visible := True
workBook.ActiveSheet.Columns("B").ColumnWidth := 5
Loop 100
{
;; 列出Excel.Application能使用的顏色碼
;ComObjError(false) ; Disable COM Object error notification
excelApp := ComObjCreate("Excel.Application")
workBook := excelApp.Workbooks.Add
excelApp.Visible := True
workBook.ActiveSheet.Columns("B").ColumnWidth := 5
iCol := 0
iRow := 1
#SingleInstance Force
sURL := "https://www.google.com/"
iBrowser := 1
if (iBrowser = 1) {
driver:= ComObjCreate("Selenium.ChromeDriver")
driver.setBinary("C:\Program Files (x86)\Google\Chrome\Application\chrome.exe")
driver.SetProfile("z:\chrome")