Last active
December 11, 2016 12:06
-
-
Save 2no/2ce42793a1b02f0025d290c9122dcb0f to your computer and use it in GitHub Desktop.
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
var diff, | |
filePath = '[file path]', | |
fso = new ActiveXObject('Scripting.FileSystemObject'), | |
file = fso.getFile(filePath), | |
date = new Date(file.dateLastModified), | |
sh = new ActiveXObject('WScript.Shell'); | |
// ペイント起動 | |
sh.run('mspaint ' + filePath); | |
while (!sh.appActivate('Paint')) { | |
WSH.sleep(100); | |
} | |
// 画像の保存 | |
sh.sendKeys('^s'); | |
// 画像の更新日チェック | |
do { | |
diff = date - new Date(file.dateLastModified); | |
} | |
while (!diff); | |
// 更新されていればペイント終了 | |
sh.sendKeys('%{F4}'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment