Skip to content

Instantly share code, notes, and snippets.

View akrnmd's full-sized avatar
🌴
On vacation

kin arima akrnmd

🌴
On vacation
View GitHub Profile
@akrnmd
akrnmd / RunOtherScriptWithParams.script
Last active October 3, 2020 00:02
Run other script with params. #SenseTalk #eggplant
//call example:
//run "RunOtherScriptWithParams" [MyText]
params MyText
TypeText MyText,Return
@akrnmd
akrnmd / UseLocalCommandAndGetResponseOnWindows.script
Last active October 3, 2020 00:02
Use Local Command And Get Response On Windows. #SenseTalk #eggplant
//use example:
//shell "c:\windows\system32\cmd.exe", <</c "ipconfig > C:\Users\[UserName]\tmp.txt">>
shell "c:\windows\system32\cmd.exe", <</c "[YourCommand] > [FileFullPath]">>
put file "[FileFullPath]" into FileContents
log FileContents
@akrnmd
akrnmd / ConnectSpecifiedNumberOfTimesUsingTry-Catch.script
Last active October 3, 2020 00:02
Connect specified number of times using Try-Catch. #SenseTalk #eggplant
Put 10 into NumberOfRetries
Put 0 into i
Repeat While i < NumberOfRetries
Try
Connect [ConnectionName]
Log ("Connect Ok")
Put i + NumberOfRetries into i
Catch
LogWarning ("Connect NG Try : " & i +1)
@akrnmd
akrnmd / GetDataFromXlsxFile.script
Last active October 3, 2020 00:02
Get Data From Xlsx File. #SenseTalk #eggplant
set ExcelFile to Workbook(ResourcePath("Data.xlsx"))
set ExcelSheet to ExcelFile.Wrksheet("Sheet1")
put ((Cell(ExcelSheet, "A1"),),) into MyCellA1
log MyCellA1
put ((ExcelSheet.Cell(1,2),),) into MyCellA2
log MyCellA2
@akrnmd
akrnmd / ReadTextByOCR.script
Last active October 3, 2020 00:01
Read Text By OCR. #SenseTalk #eggplant
Put ReadText("[ImageNameTopLeft]","[ImageNameBottomRight]") into MyText
log MyText
@akrnmd
akrnmd / MultiImageSearchAndClick.script
Last active October 3, 2020 00:01
Multi Image Search And Click. #SenseTalk #eggplant
put EveryImageLocation("[TargetImage]") into MyImageList
log MyImageList
//If the [TargetImage] is a collection, sorting may be necessary
sort MyImageList
//Click Selected Image
Click item 1 of MyImageList
@akrnmd
akrnmd / SpecifyTheDragAndDropPointByScreenRatio.script
Last active October 3, 2020 00:01
Specify The Drag and Drop (Swipe) Point By Screen Ratio. #SenseTalk #eggplant
drag (remotescreensize().x*0.5,remotescreensize().y-1)
wait 1
moveto (remotescreensize()*0.5)
wait 1
drag (remotescreensize().x,remotescreensize().y*0.5)
drop
wait 10
typetext homebutton
@akrnmd
akrnmd / CaptureAndCompareTwoImages.script
Last active October 3, 2020 00:01
Capture and compare two images. #SenseTalk #eggplant
set CaptureArea to (0, 0, 100, 100) -- Set Capture Area.
CaptureScreen "C:\Users\[UserName]\Image-Before.png", CaptureArea
//Your Actions
CaptureScreen "C:\Users\[UserName]\Image-After.png", CaptureArea
if file "C:\Users\[UserName]\Image-Before.png" as data is equal to file "C:\Users\[UserName]\Image-After.png" as data then
log "Image-Before and Image-After are same images."
@akrnmd
akrnmd / UseUserInputData.script
Last active October 3, 2020 00:01
Use User Input Data. #SenseTalk #eggplant
ask "Enter your name:"
log it
@akrnmd
akrnmd / UseGherkinSample.script
Last active October 3, 2020 00:00
UseGherkinSample. #SenseTalk #eggplant
(* add to file of "UseGherkinSample.feature" *)
//Feature: Get Screen Capture
// Scenario: Get Screen Capture
// Given connect "localhost"
// When get screenshot
// Then disconnect "localhost"
(* UseGherkinSample.script *)
to handle connect_STR
params str1