Last active
August 29, 2015 14:15
-
-
Save treeherder/5b6908739e24847ec7d4 to your computer and use it in GitHub Desktop.
a small visual basic script for curling the most recent meter capture to paste/click
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
Option Explicit | |
Function execStdOut(cmd) | |
Dim goWSH : Set goWSH = CreateObject( "WScript.Shell" ) | |
Dim aRet: Set aRet = goWSH.exec(cmd) | |
execStdOut = aRet.StdOut.ReadAll() | |
End Function | |
Dim fso, path, file, recentDate, recentFile, objShell, stdout, fullpath | |
set objShell = wscript.createObject("wscript.shell") | |
Set fso = CreateObject("Scripting.FileSystemObject") | |
Set stdout = fso.GetStandardStream (1) | |
Set recentFile = Nothing | |
For Each file in fso.GetFolder("C:\Users\jane\Documents\FFXIVAPP\ScreenShots\").Files | |
If (recentFile is Nothing) Then | |
Set recentFile = file | |
ElseIf (file.DateLastModified > recentFile.DateLastModified) Then | |
Set recentFile = file | |
End If | |
Next | |
If recentFile is Nothing Then | |
WScript.Echo "no recent files" | |
Else | |
fullpath = fso.GetAbsolutePathName(recentFile) | |
WScript.Echo execStdOut ("curl --data-binary @" & fullpath & " paste.click") | |
WScript.Echo "Recent file is " & recentFile.Name & " " & recentFile.DateLastModified & fullpath | |
end If |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment