Messages - jzippo [ switch to compact view ]

Pages: prev1 2 [3] 4 5 6next
11
I have no idea what you mean by a bookmarklet, but here's the code for SnagItCapture.js (works with SnagIt version 7):

function snagItInit(sPath, inputMode, delaySecs) {
snagIt = new ActiveXObject("SnagIt.ImageCapture"); //Global object
wshShell = new ActiveXObject("WScript.Shell"); //Global object
objFSO = new ActiveXObject("Scripting.FileSystemObject"); //Global object

//Check if file points to directory (if not, then this path is treated as a file).
//Automatic naming scheme is applied if sPath is directory
var isFolder = objFSO.FolderExists(sPath);

//-- Input constants --
snagImageInput = new Object();
snagImageInput.siiDesktop = 0;
snagImageInput.siiWindow = 1;
snagImageInput.siiRegion = 4;
snagImageInput.siiClipboard = 7;
snagImageInput.siiCustomScroll = 18;

//-- Output constants --
snagImageOutput = new Object();
snagImageOutput.sioClipboard = 4;
snagImageOutput.sioFile = 2;

//-- ImageFileType constants --
snagImageFileType = new Object();
snagImageFileType.siftBMP = 0;
snagImageFileType.siftPCX = 1;
snagImageFileType.siftTIFF = 2;
snagImageFileType.siftJPEG = 3;
snagImageFileType.siftGIF = 4;
snagImageFileType.siftPNG = 5;
snagImageFileType.siftTGA = 6;

//-- OutputImageFile.FileNamingMethod constants --
snagOutputFileNamingMethod = new Object();
snagOutputFileNamingMethod.sofnmPrompt = 0;
snagOutputFileNamingMethod.sofnmFixed = 1;
snagOutputFileNamingMethod.sofnmAuto = 2;

//-- AutoScrollMethod constants --
snagAutoScrollMethod = new Object();
snagAutoScrollMethod.sasmVertical = 1;
snagAutoScrollMethod.sasmNone = 0;
snagAutoScrollMethod.sasmHorizontal = 2;
snagAutoScrollMethod.sasmBoth = 3;

//-- AutoScrollStartingPosition constants --
snagAutoScrollStartingPosition = new Object();
snagAutoScrollStartingPosition.sasspCurrent = 0;
snagAutoScrollStartingPosition.sasspTop = 1;
snagAutoScrollStartingPosition.sasspLeft = 2;
snagAutoScrollStartingPosition.sasspTopLeft = 3;

//Select input
if (!inputMode) {
snagIt.Input = snagImageInput.siiWindow;
} else {
snagIt.Input = inputMode;
}


snagIt.Output = snagImageOutput.sioFile; //Select output
snagIt.AutoScrollOptions.AutoScrollMethod = snagAutoScrollMethod.sasmNone; //Select autoscroll

if (delaySecs && delaySecs > 0) {
snagIt.DelayOptions.DelaySeconds = delaySecs;
snagIt.DelayOptions.EnableDelayedCapture = true;
snagIt.DelayOptions.EnableCountdownWindow = true;
}

//if (pickX && pickY) {
// snagIt.InputWindowOptions.SelectionMethod = 3; //swsmPoint (default swsmInteractive)
// snagIt.InputWindowOptions.XPos = pickX;
// snagIt.InputWindowOptions.YPos = pickY;
//}

if (snagIt.Output == snagImageOutput.sioFile) {
snagIt.OutputImageFile.FileType = snagImageFileType.siftPNG;

WScript.Echo(sPath);

if (isFolder) {
snagIt.OutputImageFile.FileNamingMethod = snagOutputFileNamingMethod.sofnmPrompt;
snagIt.OutputImageFile.Directory =  sPath; //Inargument

} else {
snagIt.OutputImageFile.FileNamingMethod = snagOutputFileNamingMethod.sofnmFixed;
WScript.Echo("Save in: " + objFSO.GetParentFolderName(sPath) +"\\"+ objFSO.GetFileName(sPath));
snagIt.OutputImageFile.Directory =  objFSO.GetParentFolderName(sPath); //Inargument
snagIt.OutputImageFile.Filename = objFSO.GetFileName(sPath); //Inargument
}

//snagIt.OutputImageFile.AutoFilePrefix = filePrefix; //Inargument
//snagIt.OutputImageFile.AutoNumPrefixDigits = 4;
}


if (snagIt.AutoScrollOptions.AutoScrollMethod != snagAutoScrollMethod.sasmNone)  {
//snagIt.AutoScrollOptions.Delay = 150;
snagIt.AutoScrollOptions.ForegroundScrollingWindow = true;
snagIt.IncludeCursor = false;
snagIt.AutoScrollOptions.StartingPosition = snagAutoScrollStartingPosition.sasspTop; //Select AutoScrollStartingPosition
}
}

function printSnagItWindowInputOpts() {
WScript.Echo("InputWindowOptions.Handle: " + snagIt.InputWindowOptions.Handle);
WScript.Echo("InputWindowOptions.SelectionMethod: " + snagIt.InputWindowOptions.SelectionMethod);
WScript.Echo("InputWindowOptions.XPos: " + snagIt.InputWindowOptions.XPos);
WScript.Echo("InputWindowOptions.YPos: " + snagIt.InputWindowOptions.YPos);
}


function getFileDirArg() {
//WScript.Echo("FileDirArg: " + WScript.Arguments.Item(0));
return WScript.Arguments.Item(0);
}

function getInputModeArg() {
return (WScript.Arguments.Count() > 1) ? parseInt(WScript.Arguments.Item(1)) : undefined;
}

function getDelaySecsArg() {
return (WScript.Arguments.Count() > 2) ? parseInt(WScript.Arguments.Item(2)) : undefined;
}

function snagItCapture() {
snagIt.Capture();
while(!snagIt.IsCaptureDone) {
WScript.Sleep(500);
}

var runPath = '"' + objFSO.GetParentFolderName(WScript.ScriptFullName) + '\\nircmd.exe" clipboard set "' + snagIt.LastFileWritten + '"';
wshShell.Run(runPath);
WScript.StdErr.WriteLine(snagIt.LastError);
}

function snagItDestroy() {
//printSnagItWindowInputOpts();
snagIt = null;
snagImageInput = null;
snagImageOutput = null;
}


snagItInit(getFileDirArg(), getInputModeArg(), getDelaySecsArg());
snagItCapture();
snagItDestroy();

12
the "(.*) \+snag" trick does not work at all. It somehow screws up the parameters sent to the receiving script.

The first parameter to the SnagIt-script is the path in which to save the screen capture. Previously $$1 sent the path I selected in FARR but with this trick the 1st parameter contains the path of the script itself. The arguments thus became transposed in some way or perhaps doubled (probably doubled since the script itself is still launched).

13
The alias...

snagalias.png

14
Is it true that FARR doesn't allow one to trigger an alias action with a path that points to something that does not exist? I want to be able to do this as I would like to use FARR for constructing a path for a resource that is to be created by an alias action. That is, I would like to search for a folder in FARR, select it with TAB and then type in a name for a new file that is to be constructed by an alias action in that path. Impossible, or?

The image below shows what I mean. The path "C:\Documents and Settings\Joe\Desktop\inhere\" appears after selecting a folder in FARR with TAB. The user then adds newfile.png to the path and +snag to send it to this alias for further processing. The result of this would be that a screen capture is performed with SnagIt and saved in a file named newfile.png that SnagIt creates. Is this possible?

newfile.png

15
Find And Run Robot / Re: Dialog extension with FlashFolder and FARR2
« on: September 10, 2007, 05:58 AM »
Ok, that works so much better :)

I was wondering about the dosearch thing, is there any option that would make it list the favorites the way  that FARR does before one starts to type search terms?


Pages: prev1 2 [3] 4 5 6next
Go to full version