//******************************************************** // File: ClipToPE.js (WSH2 for JScript) // Author: (c) M. Gallant 09/12/2000 // // Automates saving bitmap image on win32 clipboard to // Microsoft Photo Editor application. //******************************************************** var host = WScript.Application; if (host != "Windows Script Host") { // check for WSH2. WScript.Echo("This script requires Windows Script Host 2") ; WScript.Quit(); } var WshShell = WScript.CreateObject("WScript.Shell") ; var PEApp = "C:\\Program Files\\Common Files\\Microsoft Shared\\PhotoEd\\PHOTOED.EXE"; var fso = WScript.CreateObject("Scripting.FileSystemObject") ; if(!fso.FileExists(PEApp)) { // check if Photo Editor application available. WScript.Echo("Photo Editor Application not found!") ; WScript.Quit(); } WshShell.Run("\"" + PEApp + "\"", 1) ; // since app path has spaces. WScript.Sleep(1200) ; // allow time for launch on slower machines. WshShell.SendKeys("%(EN)") ; // Paste as new document. (Alt+EN) WScript.Sleep(1200) ; WshShell.SendKeys("%(FA)") ; // Save As ... dialog (Alt+FA)