Skip to content

Instantly share code, notes, and snippets.

@hmasato
Last active December 17, 2015 09:49
Show Gist options
  • Select an option

  • Save hmasato/5590049 to your computer and use it in GitHub Desktop.

Select an option

Save hmasato/5590049 to your computer and use it in GitHub Desktop.
[WScript, QuickTime, Win, jscript] _openFoldersFromCurrentQT.cmd
@if(0)==(0) echo off
cscript.exe //NoLogo //E:JScript "%~f0" %*
goto :eof
@end
f1:
var ws = WScript;
var wsh = new ActiveXObject("WScript.Shell");
var wmi = GetObject("winmgmts:\\\\.\\root\\cimv2");
var qtpr = wmi.ExecQuery("Select * from Win32_Process where name='QuickTimePlayer.exe'");
if(qtpr.Count < 1) ws.Quit();
var qt = ws.CreateObject("QuickTimePlayerLib.QuickTimePlayerApp");
if(qt == null) ws.Quit();
for(var i=0; i < qt.Players.Count; i++){
var fn = qt.Players.Item(i+1).QTControl.Movie.URL;
wsh.Run("explorer.exe /select,\""+fn+"\"");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment