Help capturing screenshots from script

Hi all,
I'm helping someone with a project, I'm a fairly experienced Unix and Windows developer but don't know much about Macintosh or Applescript so please excuse me if any of these are stupid questions; if you can direct me to the relevant documentation that would be great.
I'm trying to write a script to capture screenshots (actually single window captures of the browser window) and save them to disk every N minutes.. I've seen how to do this with the Grab application, or from the command line using screencapture. I don't see how to automate either of these applications through Applescript though; when I select file-> open dictionary they aren't in the list. Does this mean I can't use applescript to drive them? If so, can anyone suggest an alternative?
2GHz PowerPC G5   Mac OS X (10.4.10)  

You can use AppleScript to execute screencapture:
<pre class="command">do shell script "screencapture -S file"</pre>

Similar Messages

  • Help: Capturing photos from camera while iPod sync

    Big problem...
    I started my canon sd600 camera to start capturing 90 pictures from my wife's birthay, but I was also sincronizing my ipod and both libraries are in an external LaCie drive.
    Immediately after I turned on camera, the iPod Sync failed and also all pictures within iPhoto dissapeared... they were showing an admiration mark... I could only see the pictures just imported from the camera...
    The only way I was able to see all pictures was to quit iPhoto and choose again the library. However, when I did this... there were NO pictures just captured!!!!!
    Sadly I selected to delete the pictures in my camera after downloading them... Now I lost 90 pictures...
    I believe they have to be somewhere since they were effectively captured... just need help to find them!
    Can anyone of you friends help me?
    MacBook Pro 17   Mac OS X (10.4.9)   External HD LaCie

    Aquarius6502
    Do a search on Macupdate using 'recover photos' and you'll get a lot of suggestions for Software that will recover the photos from your card.
    Regards
    TD

  • Help with callback from script src= with jsp processing

    I am trying to understand several different ways to get dynamic content into a system I am building. These include:
    1. <script tags to fetch text from a jsp page
    2. <img to fetch images from a jsp page
    3. AJAX to fetch text from a jsp page.
    (In all cases, the jsp pages will eventually get the data from a MySql database, but right now I am using static code.)
    I am having a problem understanding how to use the <script option.
    I am starting with an html page with a javascript callback function and a <script with the callback passed as a parameter. The callback function is based on a sample that I found that works, but I don't have the code for the called jsp page.
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
      <title>Test javascript WebServiceCalls...</title>
      <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
    <script type="text/javaScript">
      function ws_results1(obj)
           alert("in ws_results1");
           var myobj = obj.ResultSet.totalResultsAvailable;
           alert("The result is "+myobj);
           this.document.getElementById("showTest1").innerHTML =  "The result is "+myobj;
    </script>
    </head>
    <body >
    <h2 > #1 <SCRIPT tag with immediate loading..... </h2>
    WebServiceCalls #1: Use <script src="---.jsp?---&callback=---"> <br>
    -----------------------------------------------<br>
    Returned code gets inserted in calling page by callback function.  <br>
    NOTE: <br>
    1. Page will delay loading until response is received. <br>
    2. Target for callback function must preceed the %lt;script tag as it must be loaded first or it will not yet exist when the callback function executes.<br>
    <br>
    The following should be dynamically changed: <br>
    <div id="showTest1">Please wait..</div>
    The above line "Please wait.." should be replaced: <br>
    <script type="text/javascript" src="TestWS1.jsp?callback=ws_results1"></script>
    <br>
    <br>
    Rest of page loaded after return...
    </body>
    </html>The jsp page is below. I am pretty sure that I am missing something here...
    <%
       // TestWS1.jsp:  return a simple string.....
       //    (Other versions will return JSON structures or images)
    // For page imports, wrap each line within a pair to avoid blanks and linefeeds... 
    %><%@ page import="java.lang.String" %><%
    %><%@ page import="java.net.*"  %><%
    %><%@ page import="java.io.*"   %><%
    %><%@ page import="java.util.*" %><%
    %><%@ page import="javax.servlet.*"  %><%
       System.out.println("TestWS1.jsp: begin");
       //  Use PrintStream to allow very long content made up of strings...
       //    thanks to:  http://kickjava.com/1793.htm  
       ByteArrayOutputStream baos = new ByteArrayOutputStream (  ) ;
       PrintStream ps = new PrintStream ( baos ) ;
       ps.println("\"TestWS1: This is the returned string as HTML <br> This can be any HTML code.<br>\"");
       // now write the ByteArrayOutputStream to the outputstream   
       response.setContentType("text/html");
       response.setHeader("Pragma", "no-cache");
       response.setHeader("Cache-Control", "no-cache");
       response.setDateHeader("Expires", 1);
       response.setDateHeader("max-age", 0);
       OutputStream os = response.getOutputStream();
       baos.writeTo(os);
       os.close();
       System.out.println("TestWS1.jsp: done");
    %>When I run TestWS1.jsp, I get the expected entries in the system log and the expected output:
    "TestWS1: This is the returned string as HTML <br> This can be any HTML code.<br>"However, when I run the TestWS1Call.html, I get the entries in the system log but nothing fires the javascript function.
    What am I missing?
    Thank you

    I found a solution to loading dynamic content using the <script src= tag.
    This approach seems to be useful (a) for situations in the jsp content is dependent on client-side characteristics
    (such as window size) and (b) because it seems to work on any browser with javascript and does not require an
    ActiveX for older versions of IE.
    I wrapped the output of the jsp page inside a javascript call to the callback function
       ps.println(callback+"(\"TestWS1: This is the returned string as HTML <br> This can be any HTML code.<br>\")");I also changed the content type to javascript.
       response.setContentType("text/javascript");Now, when the script tag is found, the jsp page returns a javascript function call to the callback function and passes
    the desired content as a single parameter. The callback function then places the content in the appropriate
    location on the page.

  • Capture screenshots automatically

    is there a plugin that captures screenshots from my movies automatically (like every 20secons ...)?
    thanks

    iMovie 6 has that (new) feature. It lets you import video from the camera with a time-lapse effect. If you're thinking of upgrading, that is a solution.
    This is from iMovie Help:
    To create a time-lapse effect:
    Turn on your camera, and connect it to your computer. If you need help with this, see Related Topics below.
    In iMovie HD, press the camera icon (shown above), and choose Time Lapse from the pop-up menu.
    Select the Capture Frame checkbox and specify the number of frames from which you want iMovie to capture one frame of video.
    Click OK.
    Import your video into iMovie as you normally do, using the iMovie capture controls. If you need help with this, see Related Topics below.

  • Word 2010: Insert Screenshot from IE shows black thumbnail

    My environment is a QA software testing environment where we have to capture screenshots from our company software that runs in Internet Explorer 8 and 9.   Once we upgraded from Word 2007 to 2010, we started using the "Insert - Screenshot"
    feature to capture our verifications.  Any employees using remote desktop to connect to their work stations from home frequently (but not always) see a black thumbnail for IE rather than the IE screen itself.  All other screens within the screenshot
    window show properly.  Just the IE ones are sometimes black.
    And now one analyst is having the same problem logged in here at the office (not remote desktop).
    I saw one solution for disabling the "Send to Bluetooth" add-in, but we don't have that one.  Another solution recommends adding a registry entry for AllowImageProxyAuth, but no one has reported trying it and whether it worked.  I did
    not want my work PC to be the guinea pig for this.  Any recommendations?
    From other solution:
    Go to "Start" button > in the search field, type: regedit > HKEY_CURRENT_USER >Software > Microsoft > Office > 14.0 > Common "single-click" > from menu: Edit > New > DWORD (32-bit) Value > type: AllowImageProxyAuth
    > right-click this file and choose: modify > in the value data type: 1

    Hi,
    I can reproduce this error in Windows7 Office 2010(32-bit/64-bit) IE9, this issue only appear using Remote desktop to connect remote workstation. The problem cause by Remote Desktop session, it will lock out remote workstation Windows, Windows client
    service(termsrv.dll) did not support multiple user logon like Terminal Server. AFAIK, this is a known issue, Microsoft maybe fix it new update release.
    And the registry key "AllowImageProxyAuth", it's only apply to Outlook 2010 if the image is not displayed.
    http://support.microsoft.com/kb/2457649
    You can use PrintScreen as a workaround:
    Start IE > Press "PrtScn" or "Alt+PrtScn" on Keyboard > Start Word, Press "Ctrl + V" to insert screenshot.
    http://windows.microsoft.com/en-US/windows7/Take-a-screen-capture-print-your-screen
    Best Regards,
    William Zhou CHN
    TechNet Community Support

  • How can I capture a snapshot/screenshot from my game made with edge animate

    I am wondering if its possible to put a symbol button inside edge animate once the user clicks on it it downloads a screenshot from the current screen the user is on because it's a required inside the project I have made and the client is really asking for this advantage and I made the whole game with edge animate so please if anyone has any solutions to tell me about them..Thanks

    Hey, HeavenChains-
    We don't use canvas natively, so the html5 canvas screenshot may not work for you.  I did a quick websearch and there are libraries out there that may take a screenshot for you, but you may want to be wary due to privacy concerns with using third party software.
    Here's one of the ones I found (please don't take this as a recommendation, as I haven't tried it myself):
    http://grabz.it/api/javascript/
    Hope that helps,
    -Elaine

  • Help me capture stills from mov files of kodak camera created in pal format

    I did not know the difference and saved movie files on my kodak digital camera as pal format - it was top of list - i need to capture some stills as single photos from those files. I have switched to NTSC format for future and will want to capture stills from movies in that format also
    does anyone know if quicktime pro 7 will di what i want or what i need to reach my goal?

    Even the free version of QT Player allows you to "copy" frames. These could be "pasted" into a new blank using any image editing software.
    What ever frame is showing when you stop playback will be the one copied. More control by using the right left arrow keys.
    The Pro upgrade can export a frame to many image formats. It doesn't matter that the format is PAL. NTSC and PAL are TV playback settings. Your computer doesn't care.

  • Need help: Capturing from Canon XL H1 - Premiere CS&

    When i capture images from a Canon XL H1 the Premiere CS6 creates a mp3 file. How can I reate a vide

    I have heard of this issue before but have no answer to the problem.
    Might want to read this doc.
    http://kb2.adobe.com/cps/828/cpsid_82848.html

  • Make a screenshot from a panel?

    Hi,
    is it possible to make a screenshot from a panel? And save it
    in some object?

    yevgen_78,
    Flex 3 has an ImageSnapshot class which may do what you need.
    For more information, see
    http://livedocs.adobe.com/labs/flex3/langref/mx/graphics/ImageSnapshot.html
    Also, there are a few random examples at
    http://blog.flexexamples.com/category/imagesnapshot/
    which may give you some ideas.
    As for saving the pixels, you would probably need to send the
    raw image data to a server side script (ColdFusion, PHP, ASP, etc)
    to save it to a file.
    Hope that helps,
    Peter

  • PrintWindow api with possible solution for capture screenshot Google Chrome window

    Hi,
    as all you know, PrintWindow api give us a black image when us want a capture screenshot  of Google Chrome window. So, a friend said me that a possible solution for this problem is: 
    Reduce Google Chrome window for -1px in both sides and after this, reset  to original size. And so, will repaint again.
    Based on code below, someone could help me make this? sincerely I don't know where begin.
    [DllImport("user32.dll", SetLastError = true)]
    static extern IntPtr FindWindow(string lpClassName, string lpWindowName);
    [DllImport("user32.dll", SetLastError = true)]
    static extern IntPtr FindWindowEx(IntPtr hwndParent, IntPtr hwndChildAfter, string lpszClass, string lpszWindow);
    [DllImport("user32.dll")]
    private static extern IntPtr GetDC(IntPtr WindowHandle);
    [DllImport("user32.dll")]
    private static extern void ReleaseDC(IntPtr WindowHandle, IntPtr DC);
    [DllImport("user32.dll")]
    private static extern IntPtr GetWindowRect(IntPtr WindowHandle, ref Rect rect);
    [DllImport("User32.dll", SetLastError = true)]
    [return: MarshalAs(UnmanagedType.Bool)]
    static extern bool PrintWindow(IntPtr hwnd, IntPtr hDC, uint nFlags);
    [StructLayout(LayoutKind.Sequential)]
    private struct Rect
    public int Left;
    public int Top;
    public int Right;
    public int Bottom;
    public static Bitmap Capture(IntPtr handle)
    Rect rect = new Rect();
    GetWindowRect(handle, ref rect);
    Bitmap Bmp = new Bitmap(rect.Right - rect.Left, rect.Bottom - rect.Top);
    Graphics memoryGraphics = Graphics.FromImage(Bmp);
    IntPtr dc = memoryGraphics.GetHdc();
    bool success = PrintWindow(handle, dc, 0);
    memoryGraphics.ReleaseHdc(dc);
    return Bmp;
    private void button1_Click(object sender, EventArgs e)
    IntPtr WindowHandle = FindWindowEx(IntPtr.Zero, IntPtr.Zero, "Chrome_WidgetWin_1", null);
    Bitmap BMP = Capture(WindowHandle);
    BMP.Save("C:\\Foo.bmp");
    BMP.Dispose();
    Any suggestions here is appreciated.

    Hello,
    I would prefer capture the screen rather than get it from that application directly.
    It has been discussed in the following thread.
    Is there any way to hide Chrome window and capture a screenshot or convert the Chrome window to image?
    In this case, you could remove the line "ShowWindowAsync(mainHandle, 0); " since you don't want to hide it.
    using System;
    using System.Runtime.InteropServices;
    using System.Diagnostics;
    using System.Drawing.Imaging;
    [DllImport("user32.dll")]
    private static extern bool ShowWindowAsync(IntPtr hWnd, int nCmdShow);
    [DllImport("user32.dll")]
    public static extern bool GetWindowRect(IntPtr hWnd, out RECT lpRect);
    [DllImport("user32.dll")]
    public static extern bool PrintWindow(IntPtr hWnd, IntPtr hdcBlt, int nFlags);
    public WhateverMethod()
    //initialize process and get hWnd
    Process chrome = Process.Start("chrome.exe","http://www.cnn.com");
    //wait for chrome window to open AND page to load (important for process refresh)
    //you might need to increase the sleep time for the page to load or monitor the "loading" title on Chrome
    System.Threading.Thread.Sleep(4000);
    chrome.Refresh();
    IntPtr mainHandle = chrome.MainWindowHandle;
    RECT rc;
    GetWindowRect(mainHandle, out rc);
    Bitmap bmp = new Bitmap(rc.Width, rc.Height, PixelFormat.Format32bppArgb);
    Graphics gfxBmp = Graphics.FromImage(bmp);
    IntPtr hdcBitmap = gfxBmp.GetHdc();
    PrintWindow(mainHandle, hdcBitmap, 0);
    gfxBmp.ReleaseHdc(hdcBitmap);
    gfxBmp.Dispose();
    bmp.Save("c:\\temp\\test.png", ImageFormat.Png);
    ShowWindowAsync(mainHandle, 0);
    [StructLayout(LayoutKind.Sequential)]
    public struct RECT
    private int _Left;
    private int _Top;
    private int _Right;
    private int _Bottom;
    public RECT(RECT Rectangle)
    : this(Rectangle.Left, Rectangle.Top, Rectangle.Right, Rectangle.Bottom)
    public RECT(int Left, int Top, int Right, int Bottom)
    _Left = Left;
    _Top = Top;
    _Right = Right;
    _Bottom = Bottom;
    public int X
    get { return _Left; }
    set { _Left = value; }
    public int Y
    get { return _Top; }
    set { _Top = value; }
    public int Left
    get { return _Left; }
    set { _Left = value; }
    public int Top
    get { return _Top; }
    set { _Top = value; }
    public int Right
    get { return _Right; }
    set { _Right = value; }
    public int Bottom
    get { return _Bottom; }
    set { _Bottom = value; }
    public int Height
    get { return _Bottom - _Top; }
    set { _Bottom = value + _Top; }
    public int Width
    get { return _Right - _Left; }
    set { _Right = value + _Left; }
    public Point Location
    get { return new Point(Left, Top); }
    set
    _Left = value.X;
    _Top = value.Y;
    public Size Size
    get { return new Size(Width, Height); }
    set
    _Right = value.Width + _Left;
    _Bottom = value.Height + _Top;
    public static implicit operator Rectangle(RECT Rectangle)
    return new Rectangle(Rectangle.Left, Rectangle.Top, Rectangle.Width, Rectangle.Height);
    public static implicit operator RECT(Rectangle Rectangle)
    return new RECT(Rectangle.Left, Rectangle.Top, Rectangle.Right, Rectangle.Bottom);
    public static bool operator ==(RECT Rectangle1, RECT Rectangle2)
    return Rectangle1.Equals(Rectangle2);
    public static bool operator !=(RECT Rectangle1, RECT Rectangle2)
    return !Rectangle1.Equals(Rectangle2);
    public override string ToString()
    return "{ + _Left + "; " + " + _Top + "; Right: " + _Right + "; Bottom: " + _Bottom + "}";
    public override int GetHashCode()
    return ToString().GetHashCode();
    public bool Equals(RECT Rectangle)
    return Rectangle.Left == _Left && Rectangle.Top == _Top && Rectangle.Right == _Right && Rectangle.Bottom == _Bottom;
    public override bool Equals(object Object)
    if (Object is RECT)
    return Equals((RECT)Object);
    else if (Object is Rectangle)
    return Equals(new RECT((Rectangle)Object));
    return false;
    And the key method used is the one shared in
    Get a screenshot of a specific application.
    Regards,
    Carl
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Capture image from isight

    What is the best way to capture images from iSight using Applescript ?

    erritikamathur wrote:
    What is the best way to capture images from iSight using Applescript
    (1) Depending on what you want to do, you may be able to use your "Automator" application to make your scripts instead (Automator calls them "workflows".)
    When you launch Automator, you can immediately select the "Photos & Images" as a starting point to see if it will meet your needs by selecting "my Computer's Camera" in the "Get content from:" choices bar there.
    For more info on Automator, start with Mac 101: Automator and then launch Automator on your Mac and use its Automator > Help as needed.
    (2) If you really need to use AppleScript, you need to understand that you script applications (such as iChat), not devices (like iSight.) Therefore, first decide what you want to do with your iSight. Click -> here to see a list of some applications that can operate your iSight.
    Once you have decided what you want to do, launch your Mac's AppleScript Script Editor.
    Next, open Script Editor's Library window to see a list of Apple apps that are scriptable. Those that can control iSight include iChat, iMovie, and iPhoto. Double-click on one of the apps of interest to see the dictionary of functions that can be scripted in that application. Reviewing the library for any app will help you determine whether the functions you want to control can be scripted in that app. If not, you need to find another app that can control that function, develop an alternate process flow that can be scripted, or look for a way to accomplish your task other than with AppleScript.
    Some third party apps may also be scriptable. See the documentation or support info for particulars directly from the developers of those apps.
    More help is available from a variety of sources. For instance, you can check your Mac's Help on specific applications to see if they contain info on automating them. One specific example is iChat > Help, which gives a good start on your iChat study.
    Unless you already know how to use AppleScript, you may also need to do some more general study or perhaps take advantage of the Apple training series book available from the Apple Store.
    EZ Jim
    G5 DP 1.8GHz w/Mac OS X (10.5.7) PowerBook 1.67GHz (10.4.11)   iBookSE 366MHz (10.3.9)  External iSight

  • Adding a screenshot via script

    I often have to put a screenshot in photos of computers and tvs and I want to be able to script this somehow. If I set a path, or shape, or points, is there a way to take another image and place it to fit inside those point (so all corners would meet?) Right now I just place the screenshot image on a separate layer and use Distort transform to match the corners of the screen and screenshot.
    Any thoughts?

    Some time ago I stumbled onto something that I’m afraid I don’t quite comprehend in »Geometry.jsx«, but might help you.
    This Script should transform the activeLayer according to a path named »screen« if it has four points – the Script might need some more work …
    // this script attempts to fit the activeLayer into an area defined by a path named »screen«;
    // use it at your own risk;
    #target photoshop
    // from adobe’s terminology.jsx;
    const classChannel = app.charIDToTypeID('Chnl');
    const classRectangle = app.charIDToTypeID('Rctn');
    const enumNone = app.charIDToTypeID('None');
    const eventSet = app.charIDToTypeID('setd');
    const eventTransform = app.charIDToTypeID('Trnf');
    const keySelection = app.charIDToTypeID('fsel');
    const krectangleStr = app.stringIDToTypeID("rectangle");
    const kquadrilateralStr = app.stringIDToTypeID("quadrilateral");
    const keyBottom = app.charIDToTypeID('Btom');
    const keyLeft = app.charIDToTypeID('Left');
    const keyNull = app.charIDToTypeID('null');
    const keyRight = app.charIDToTypeID('Rght');
    const keyTo = app.charIDToTypeID('T   ');
    const keyTop = app.charIDToTypeID('Top ');
    const typeOrdinal = app.charIDToTypeID('Ordn');
    const unitPixels = app.charIDToTypeID('#Pxl');
    // from adobe’s geometry.jsx;
    // =================================== TPoint ===================================
    function TPoint( x, y )
         this.fX = x;
         this.fY = y;
    // TPoint Constants
    const kTPointOrigion = new TPoint( 0, 0 );
    TPoint.kOrigin = kTPointOrigion;
    const kTPointInfinite = new TPoint( Infinity, Infinity );
    TPoint.kInfinite = kTPointInfinite;
    const kTPointClassname = "TPoint";
    TPoint.prototype.className = kTPointClassname;
    // Overloaded math operators
    TPoint.prototype["=="] = function( Src )
         return (this.fX == Src.fX) && (this.fY == Src.fY);
    TPoint.prototype["+"] = function( b )
         return new TPoint( this.fX + b.fX, this.fY + b.fY );
    TPoint.prototype["-"] = function( b, reversed )
         if (typeof(b) == "undefined")          
    // unary minus
              return new TPoint( -this.fX, -this.fY )
         else
              if (reversed)
                   return new TPoint( b.fX - this.fX, by.fY - this.fY );
              else
                   return new TPoint( this.fX - b.fX, this.fY - b.fY);
    // Multiply and divide work with scalars as well as points
    TPoint.prototype["*"] = function( b )
        if (typeof(b) == 'number')
              return new TPoint( this.fX * b, this.fY * b );
         else
              return new TPoint( this.fX * b.fX, this.fY * b.fY );
    TPoint.prototype["/"] = function( b, reversed )
         if (reversed)
              if (typeof(b) == "number")
                   debugger;
    // Can't divide a number by a point
              else
                   return new TPoint( b.fX / this.fX, b.fY / this.fY );
         else
              if (typeof(b) == 'number')
                   return new TPoint( this.fX / b, this.fY / b );
              else
                   return new TPoint( this.fX / b.fX, this.fY / b.fY );
    TPoint.prototype.toString = function()
         return "[" + this.fX.toString() + "," + this.fY.toString() + "]";
    TPoint.prototype.vectorLength = function()
        return Math.sqrt( this.fX * this.fX + this.fY * this.fY );
    var myDocument = app.activeDocument;
    // assumes the activeLayer is the screenshot;
    var theScreenshot = myDocument.activeLayer;
    var screenFound = false;
    // switch units to pixels;
    var originalUnits = app.preferences.rulerUnits;
    app.preferences.rulerUnits = Units.PIXELS;
    try {myDocument.pathItems[0].select();
         myDocument.pathItems[0].deselect()}
    catch (e) {};
    myDocument.selection.deselect();
    var thePathList = new Array;
    // verify document has paths;
    if (myDocument.pathItems.length > 0) {
    // create list of possible paths;
         for (var g = 0; g < myDocument.pathItems.length; g++) {
              if (myDocument.pathItems[g].subPathItems.length == 1 && myDocument.pathItems[g].subPathItems[0].pathPoints.length == 4) {
    // if a fitting path is named screen, take it;
                   if (myDocument.pathItems[g].name == "screen") {
                        var aPath = myDocument.pathItems[g];
                        var screenFound = true
                   else {                    
                        thePathList = thePathList.concat(myDocument.pathItems[g].name)
    // alert if no useable path has been found;
    if (screenFound == false) {
         if (thePathList.length == 0) {
              alert ("no four-points-path available")
         else {
    // if only one path is ok, take it;
              if (thePathList.length == 1) {
                   var aPath = myDocument.pathItems.getByName(thePathList[0]);
                   var screenFound = true
    // else offer the selection;
              else {
                   var aPath = selectAPath ();
                   if (aPath.kind == PathKind.NORMALPATH) {
                        screenFound = true;
    // when no path has been found;
    else {
         alert ("The document contains no paths")
    //////////// transformation ////////////
    try {
    //////////// corners ////////////
    // get the horicontal and vertical coordinates in pixels;
    var hor1 = Number(aPath.subPathItems[0].pathPoints[0].anchor[0]);
    var hor2 = Number(aPath.subPathItems[0].pathPoints[1].anchor[0]);
    var hor3 = Number(aPath.subPathItems[0].pathPoints[2].anchor[0]);
    var hor4 = Number(aPath.subPathItems[0].pathPoints[3].anchor[0]);
    var ver1 = Number(aPath.subPathItems[0].pathPoints[0].anchor[1]);
    var ver2 = Number(aPath.subPathItems[0].pathPoints[1].anchor[1]);
    var ver3 = Number(aPath.subPathItems[0].pathPoints[2].anchor[1]);
    var ver4 = Number(aPath.subPathItems[0].pathPoints[3].anchor[1]);
    // order the horicontal and vertical coordinates;
    var horList = [hor1, hor2, hor3, hor4];
    var verList = [ver1, ver2, ver3, ver4];
    horList.sort(sortNumber);
    verList.sort(sortNumber);
    // check the horicontal value;
    var leftPoints = new Array;
    var rightPoints = new Array;
    for (var k=0; k<aPath.subPathItems[0].pathPoints.length; k++) {
         if (aPath.subPathItems[0].pathPoints[k].anchor[0] == horList[0] ||  aPath.subPathItems[0].pathPoints[k].anchor[0] == horList[1]) {
              leftPoints = leftPoints.concat(aPath.subPathItems[0].pathPoints[k].anchor)
         else {
              rightPoints = rightPoints.concat(aPath.subPathItems[0].pathPoints[k].anchor)
    // define the four cornerpoints;
    if (leftPoints[1] <= leftPoints[3]) {
         var aTopLeft = [leftPoints[0], leftPoints[1]]
         var aBottomLeft = [leftPoints[2], leftPoints[3]];
    else {
         var aTopLeft = [leftPoints[2], leftPoints[3]]
         var aBottomLeft = [leftPoints[0], leftPoints[1]];
    if (rightPoints[1] <= rightPoints[3]) {
         var aTopRight = [rightPoints[0], rightPoints[1]]
         var aBottomRight = [rightPoints[2], rightPoints[3]];
    else {
         var aTopRight = [rightPoints[2], rightPoints[3]]
         var aBottomRight = [rightPoints[0], rightPoints[1]];
    //////////// transform to the new corners ////////////
    transformActiveLayer( [new TPoint(aTopLeft[0], aTopLeft[1]), new TPoint(aTopRight[0], aTopRight[1]), new TPoint(aBottomRight[0], aBottomRight[1]), new TPoint(aBottomLeft[0], aBottomLeft[1])]);
    catch (e) {"error"};
    // resets the preferences units;
    app.preferences.rulerUnits = originalUnits;
    //////////// the  functions ////////////
    // the dialog for multiple possible paths;
    function selectAPath () {
         var dlg = new Window('dialog', "Select a path to use for the perspective", [500,300,820,380])          
         dlg.pathSel = dlg.add('dropdownlist', [12,13,306,35], (thePathList));
         dlg.pathSel.selection = dlg.pathSel[0];
         dlg.buildBtn = dlg.add('button', [13,42,158,67], 'OK', {name:'ok'});
         dlg.cancelBtn = dlg.add('button', [168,42,313,67], 'Cancel', {name:'cancel'});
         var myReturn = dlg.show ();
         if (myReturn == true) {
              var aPath = myDocument.pathItems.getByName(dlg.pathSel.selection);
         return aPath
    // sort numbers, found at www.w3schools.com;
    function sortNumber(a,b) {
         return a - b;
    // from adobe’s stacksupport.jsx;
    // Apply a perspective transform to the current layer, with the
    // corner TPoints given in newCorners (starts at top left, in clockwise order)
    // Potential DOM fix
    function transformActiveLayer( newCorners )
         function pxToNumber( px )
              return px.as("px");
         var saveUnits = app.preferences.rulerUnits;
         app.preferences.rulerUnits = Units.PIXELS;
         var i;
         var setArgs = new ActionDescriptor();
         var chanArg = new ActionReference();
         chanArg.putProperty( classChannel, keySelection );
    //     setArgs.putReference( keyNull, chanArg );
         var boundsDesc = new ActionDescriptor();
         var layerBounds = app.activeDocument.activeLayer.bounds;
         boundsDesc.putUnitDouble( keyTop, unitPixels, pxToNumber( layerBounds[1] ) );
         boundsDesc.putUnitDouble( keyLeft, unitPixels, pxToNumber( layerBounds[0] ) );
         boundsDesc.putUnitDouble( keyRight, unitPixels, pxToNumber( layerBounds[2] ) );
         boundsDesc.putUnitDouble( keyBottom, unitPixels, pxToNumber( layerBounds[3] ) );
    //     setArgs.putObject( keyTo, classRectangle, boundsDesc );
    //     executeAction( eventSet, setArgs );
         var result = new ActionDescriptor();
         var args = new ActionDescriptor();
         var quadRect = new ActionList();
         quadRect.putUnitDouble( unitPixels, pxToNumber( layerBounds[0] ) );
    // ActionList put is different from ActionDescriptor put
         quadRect.putUnitDouble( unitPixels, pxToNumber( layerBounds[1] ) );
         quadRect.putUnitDouble( unitPixels, pxToNumber( layerBounds[2] ) );
         quadRect.putUnitDouble( unitPixels, pxToNumber( layerBounds[3] ) );     
         var quadCorners = new ActionList();
         for (i = 0; i < 4; ++i)
              quadCorners.putUnitDouble( unitPixels, newCorners[i].fX );
              quadCorners.putUnitDouble( unitPixels, newCorners[i].fY );
         args.putList( krectangleStr, quadRect );
         args.putList( kquadrilateralStr, quadCorners );
         executeAction( eventTransform, args );     
    // Deselect
         deselArgs = new ActionDescriptor();
         deselRef = new ActionReference();
         deselRef.putProperty( classChannel, keySelection );
         deselArgs.putReference( keyNull, deselRef );
         deselArgs.putEnumerated( keyTo, typeOrdinal, enumNone );
         executeAction( eventSet, deselArgs );
         app.preferences.rulerUnits = saveUnits;

  • Scripting - Passing and Enterprise variable from script to script

    Hello all,
    We are using UCCX 7.0_SR5
    I am looking to be able to pass a captured variable from one script to another.
    We use a message in queue where a caller waiting in queue can choose to leave a message and then that message is queued back into the sytem for the next available agent. When that agent recieves the message in queue they basically call back out to the customer leaving the message.
    We capture a variable in the first script when they decide to leave a message. The variable holds the call back number that they enter into the system. There is a second script that presents these message in queue calls to the agents. We would like to pass that variable that holds the number enterend by the customer to the second script so that that number appears on CAD in the enterprise data fields. The reason behind this is so the agent has a number to call back in the event they don't reach anyone when the system calls back out and the message left by the customer does not contain a call back number.
    How can I pass that variable from one script to another so it can be presented in CAD for the agents?
    Thanks for any help and let me know if you need any further information.

    You would use a "Get Call Contact Info" step to set your callerID variable, where the "Calling Number" attribute is set to your callerID variable.

  • Unable to capture video from VHS through DAC-200

    (Running Final Cut Pro 5.1.4)
    I have a DAC-200 to hook up my VCR to my G5 in order to capture video from VHS tapes into Final Cut. I had this set-up working a few months ago, but it was disconnected to rearrange equipment and now I can't get it working again. I have followed the advice from the DAC-200 installation instructions and advice from other forum topics but can't seem to get it to work. I finally was able to get something in the log and capture window besides "preview disabled" and "cannot capture because there is no video." I now can get Final Cut to capture video, however it only captures a blank black screen (and this is all I can see in the preview window).
    I've triple-checked every cable hook-up, the G5 recognizes the converter box, the video tape plays fine to a tv. I've even had our IT-guy here at work come check out my set-up for help and he can't figure out what is wrong either. (He did get my log&capture window to get white fuzz in the black screen at one point though. Does that mean anything?)
    Any help is greatly appreciated! (I'm happy to answer any other questions too.) Thanks!

    I had difficullty with the X.4.10 plus QT7.2 and put my info on the Forum as well as sending feedback to Apple. Shortly afterwards, Apple brought out a short security update which I downloaded and, hey presto, I was then able to use QT7.2 with OSX.4.10. It may be that you missed out on the later small update to QT7.2..... ? Another factor I found was that some little while later I again had a problem so I again installed QT7.2 and over-installed FCP5.1.4 which has resolved my problems for the time being. Worth a try if you still can't get through on the DAC.
    Ron.

  • Unable to capture data from drop down list in custom added field in migo tcode at item level

    Hi guys,
    need bit help in resolving query related to custom added field in Tcode migo.
    i have added a field in migo at item level ,in this i have used drop down list
    to get data but unable to capture data from drop down list.gown through
    many blogs in scn but unable to resolve.
    Please help me out in this.
    Thanks,
    Umakant.

    Hi,
    U can use following code to fill the list box
    write this code in PBO
    In layout editor please select listbox in dropdown attribute of input field and put some fctcode attribute
    TYPE-POOLS vrm.
      DATA values TYPE vrm_values WITH HEADER LINE.
      TABLES: <ur custom Database table>.
      clear values, values[].
      SELECT * FROM <ur custom Database table>.
        values-text = <TABLE FIELD TO DISPLAY IN DROPDOWN> .
        values-key = <TABLE KEY FIELD TO DISPLAY IN DROPDOWN>.
        APPEND values.
      ENDSELECT.
      CALL FUNCTION 'VRM_SET_VALUES'
        EXPORTING
          id              = '<SCREEN INPUT FIELD NAME>'
          values          = values[]
        EXCEPTIONS
          id_illegal_name = 1
          OTHERS          = 2.
    Also please define the following before accessing the listbox value
    data: <listbox input field name> type <table field name>,
            <inputfield name where text to display> type string  in top include
    In PAI, select the text from the table into <inputfield name where text to display>  depending on value selected which will be called when enter key is pressed or any vale is selected

Maybe you are looking for

  • Deleting Aperture trash

    Recently I obtained a new iMac and had to move my pictures to an external disc. I have encountered a problem with deleting Aperture trash from that disc. When I delete the trash I get a message that files cannot be moved to System Trash because I "do

  • How to transfer number to Excel column letter

    I want to write a table into Excel file with fomula "=AVERAGE(G18:G64)", how to transfer table column nunber into excel column letter? for example, from table column 7, how to know 7 means G in excel? thanks!

  • Fm Radio problems

    Hello , My name Is Egzon and I have a blackberry bold 9790 , it is perfect but I have a small problem . My problem is that my BlackBerry Bold 9790 does not have Fm Radio , I Need to know if this is for all Blackberry bold's or is only my problem . I

  • I'm missing the "Package" feature in Illustrator CS6

    I have just realised I do not have the "Package" feature in my Illustrator CS 6. ?? Should it be there? Do I need to reinstall the software? I mostly use Indesign where this feature has always been used for packaging projects. Hear from some one soon

  • "Take Picture" workflow -- what cameras are supported?

    Hi everyone, I'm new to Automator, and trying to build a workflow to send a live picture from a digital camera into a photo program. Apple has the "Take Picture" component, but I can't seem to find a list of cameras that are compatible with it. Does