Script for moving playhead to last frame, then exporting jpg?

Hi,
I have a lot of Flash files for which I need to export jpgs of their last frame. Could a kind soul out there guide me on how to write a command for moving the timeline's playhead to the last frame, then exporting a jpg (at Full Document Size, 72 dpi, 96% quality)?
A million thanks,
Kevin

private function snapshotLastFrame():void
gotoAndStop( this.totalFrames );
_bitmapData                         = new BitmapData( stage.stageWidth, stage.stageHeight );
_bitmap                              = new Bitmap( _bitmapData );
_bitmapData.draw ( stage );
saveImageJPG( _bitmapData, "test.jpg", 96 );
public function saveImageJPG( bitmapData:BitmapData, fileName:String, quality:int ):void {
            this.jpgEncoder = new JPGEncoder( quality );
            this.fileReference = new FileReference();
            this.fileReference.save( this.jpgEncoder.encode( bitmapData ), fileName + ".jpg" );
Keep in mind that you need a few extra libraries to be able to create a jpeg.. (AS3CoreLib) can be found at googleCode.

Similar Messages

  • Need script for moving files to specific directories base on csv

    Hi,
    I have a question. I have about 2000 files (pdf), which I need move to specific directories and subdirectories, which are based on csv file.
    Csv is looking like this:
    filename;directoryname;subdirectoryname;subdirectoryname;.......etc.
    I have a script for creating directories with subdirectories from csv file, but I need this script for moving files to this directories.....
    Thanks a lot for every help.
    Best Regards
    Petr, OS X Mavericks

    private function snapshotLastFrame():void
    gotoAndStop( this.totalFrames );
    _bitmapData                         = new BitmapData( stage.stageWidth, stage.stageHeight );
    _bitmap                              = new Bitmap( _bitmapData );
    _bitmapData.draw ( stage );
    saveImageJPG( _bitmapData, "test.jpg", 96 );
    public function saveImageJPG( bitmapData:BitmapData, fileName:String, quality:int ):void {
                this.jpgEncoder = new JPGEncoder( quality );
                this.fileReference = new FileReference();
                this.fileReference.save( this.jpgEncoder.encode( bitmapData ), fileName + ".jpg" );
    Keep in mind that you need a few extra libraries to be able to create a jpeg.. (AS3CoreLib) can be found at googleCode.

  • Shell script for moving and renaming files

    I'm not so familiar with shell scripts. I have created some simple scripts for various tasks but now I hit something I can't handle myself.
    My server receives every night a logfile from another server. This file I need to rename and move to another location. Problem is that a simple mv with new filename isn't enough, I need to insert date in filename. Format for date should be ddmmyy. Also the name of incoming file changes every night. The output always starts with same letters, let's say "log", and the date is used to identify files.
    For example I receive a file /Input/filename.log and I need to move the file to the folder /Output with name log130308.txt.
    Any tips how to insert the date as part of of filename while renaming or moving the file? I prefer shell script as I'll use launchd for scheduling the script.

    Hi again,
    so far I've constructed this:
    cd /input
    for file in `ls *log`
    do
    echo "Copying " $file
    cp $file /output/log.$file.`date +%d%m%y`
    done
    Quite there. I'm cding to directory, i'll focus later how to set some environmental parameters.
    Problem with zipping is that I don't know exact logfiles names. Each day there's a new name. So zip -q filename.zip filename.log isn't quite enough and it's impossible to use wildcards. The switch -q and checksums were welcome suggestions.
    Thanks again,
    Juha
    Message was edited by: J.Otava

  • Moving playhead in 10 frame increments

    I'm pretty such this can be done, but I forget how.
    If I want to move my timeline (or viewer) playhead ahead 10 frames every time
    I hit the right arrow, how is that accomplished?
    Thanks.

    Hi:
    Read this thread:
    http://discussions.apple.com/thread.jspa?messageID=3589910&#3589910
    AFAIK you cannot program the arrow keys to jump that way . . . but I'm still learning.
      Alberto

  • A script for moving files to folder ? or relaunch photoshop

    I'm looking for a very simple java script to check file corruption
    it should:
    1.open a file I send to it (via droplet)
    2.if it works > close the file > send the file to a folder like c:/checked/
    3.if the open sequence crashes or doesn't work > re launch photoshop
    4.mark the file as beeing corrupt or send it to a another folder
    I don t know how to move a file via java script without saving
    I don t know how I can relaunch ? force-quit photoshop ? is this even possible ?
    Regards

    Anstellos1 wrote:
    xbytor2 > thats the exact problem I'm having. If there is a "wrong" file into my batch, photoshop stop/ crash, is waiting for an action on my side... the whole idea of using photoshop droplets is to do it without me.
    Should I parse the files (I have jpegs; png and raws... parsing raws ?)? Would it be better like someone said to use a script that "try catch"? (no idea what it is or how to write this). I also red that photoshop image processing is skipping bad files, is that true ? how could I apply this technique ?
    bad file > skip > no crash > process continue running would be even better than the original validation idea
    "Unfortunately, there are types of jpeg corruptions that cause PS to  throw up a 'Broke File' dialog in spite of how you open the file or have  your DialogModes preferences set. PS just stops cold waiting for user  interaction. I'll see if I can locate one of these that I used to test  with. The last time I looked at this problem in depth (CS2 or CS3) PS  was still misbehaving.
    xbytor2 if much more of an expert than I am in the script area so will have to defer to him"
    I would have to defer to xbytor2 since he is much more of an expert than I in scripting.  If the Try....Catch construct does not work, than Image Processor in PS and also accessed by Bridge would fail under the same circumstances since that is the construct  that script uses.  Interesting
    "How would you write that ? Are you saying that if I use this script  at the beginning of my photoshop droplets, it won't crash on a bad file and continue looping on the next ?:"
    If you want to use the Try...Catch constructs looking at the Image Processor Code from ExtendScript ToolKit (or other script editor) would let you see how it operates.  They use the Try...Catch construct in multiple locations in that script.
    At the highest level in Image Processor here is the basic code below for the Try...Catch construct with most everything else stripped out.
    There are two main steps. One is to set the app.displayDialogs mode to NO. The second is to use the try...catch construct below.   The error routine is the catch portion of the code just displays the error code.  Then the dialog mode is reinstated to the original settings set by the User.   The same construct is used deeper into the code so that would be a source of at least the approach Image Processor uses.
    try {
        // remember the dialog modes
        gSaveDialogMode = app.displayDialogs;
        app.displayDialogs = DialogModes.NO;
        Code you want to execute goes here
    // Lot's of things can go wrong
    // Give a generic alert and see if they want the details
    catch( e ) {
        if ( e.number != 8007 ) { // don't report error on user cancel
            alert( e + " : " + e.line );
    // restore the dialog modes
    app.displayDialogs = gSaveDialogMode;

  • Need help with a script for moving bulk users to another OU and removing/assigning groups

    I've never used PowerShell before and have been asked to track down a script that can move bulk users from one OU to another, and remove and assign new group membership. I've been googling it for about 30 minutes and haven't really gotten anywhere. If
    somebody can point me in the right direction or give some tips I'd greatly appreciate it. I'm sure this kind of task has been done by several people in similar environments I just haven't been able to find those people/examples. 

    Here's what I've got so far...
    Moving to new OU
    CSV constructed like below...
    DN  
                                                                                                                                                    TargetOU
    “CN=John R, OU=BB,OU=ES,OU=Students,OU=OSD,DC=usd233,=DC=local”
                          "OU=PRT,OU=MS,OU=Students,OU=OSD,DC=usd233,DC=local"
    Import-Module activedirectory
    $UserList = Import-Csv "c:\yourCSVhere.csv"
    foreach ($User in $UserList) {
    $User.DN
    $User.TargetOU
    Move-ADObject -Identity $User.DN -TargetPath $User.TargetOU
    Would this work? I also need to remove the user from two groups and add them to two different groups as well. Would I need to use the addUsertoGroups and removeUserfromGroups commands?

  • Script for moving multiple subtitle clips in the works - EXAMPLES NEEDED!

    Hi everyone!
    One severe deficiency of DVD Studio Pro is the inability to move multiple subtitle clips back or forward in a track by an arbitrary offset.
    I ran into this problem while I was creating a DVD from an EyeTV recording of a DVB broadcast, the subtitles from which have to be extracted to a SON file and a bunch of .bmp images with a separate piece of software, ProjectX. For some reason, ProjectX messed up the subtitle timecodes, so I had to move the entire track forward by a fixed amount. Unable to do this inside DSP, and unable to find tools that would do this for SON files, I set out to code my own tool with Python.
    Currently, I have a very simplistic working version of the script, which I successfully used to shift the timecodes of the aforementioned SON file.
    This got me thinking: I can't be the only one who has faced this problem. So, in the spirit of giving something back to the community, I thought I'd try my hand at turning this little script into a versatile tool for timescaling several different subtitle formats.
    If possible, I would like to receive real-life examples of several different plaintext (no binary formats, thanks) subtitle formats from you guys, both those that DSP supports and those that it doesn't.
    For now the tool only shifts entire tracks and works on the command line, but who knows, maybe I'll create a GUI at some point and add the ability to shift specific subtitle clips instead of whole tracks - time permitting, of course.
    If you think you might have some juicy subtitles laying around, please reply or contact me directly by e-mail: elamaton (at) nic.fi. Don't worry, I won't redistribute anything you send me, it will only be used as test data.
    iMac Core Duo 20"   Mac OS X (10.4.7)  

    Sounds like a very good idea... but have you seen Subtitler:
    http://www.versiontracker.com/dyn/moreinfo/macosx/26322
    Not to say you won't make a better version, and I'd be delighted if you did! Manipulating subs in DVDSP is not something I do any more - I use an external text editor for any job where more than a few subs are needed.
    The problem in DVDSP is that you cannot extract the subs directly, you have to export an track item description which has the subs and time code buried within the XML. You might find that PHP will give you a web based tool to extract the subs and time codes and write a text file, which you can then manipulate.
    In fact, wouldn't a web based tool be a good idea? People could upload the track description, it would export the subs and you could get it to adjust the timecodes and write a text file back in the correct format to import back in to DVDSP. Once the subs are in a text file it is a simple matter to manipulate them further...

  • Script for moving files and directory to archive

    Hi,
    I've search the web for good working script to archive my files and folder with no luck.
    do you have a script that move and preserve the structure of older files and folders that have not been accessed for X days?

    Hello, I found this quite quickly in the TechNet Gallery. It seems like it would do what you're looking to do.
    https://gallery.technet.microsoft.com/Archive-old-files-with-042f859a
    # Powershell script - move old files to an archive location.
    # Writes log files to $logpath
    # Ver 0.6
    $path = "C:\TEMP"
    $archpath = "D:\TEMP-ARCH"
    $days = "30"
    $logpath = "C:\Temp"
    $date = Get-Date -format yyyyMMddHHmm
    write-progress -activity "Archiving Data" -status "Progress:"
    If ( -not (Test-Path $archpath)) {ni $archpath -type directory}
    Get-Childitem -Path $path -recurse| Where-Object {$_.LastWriteTime -lt (get-date).AddDays(-$days)} |
    ForEach { $filename = $_.fullname
    try { Move-Item $_.FullName -destination $archpath -force -ErrorAction:SilentlyContinue
    "Successfully moved $filename to $archpath" | add-content $logpath\log-$date.txt }
    catch { "Error moving $filename: $_ " | add-content $logpath\log-$date.txt }

  • Script for replacing Image from a frame into InDesign document file

    Hi All,
    I am having an indesign document (indd) file with images and texts. I am using InDesign Server CS4 to run the scripts via SOAP.
    My requirement is to replace any of the images from the required frame/s of indesign document through scripting (I already have frame id of which image needs to be replaced). I have written written java-script file (as given below): but when I execute this java-script on InDesign Server via SOAP, I get follwoing error into InDesign Server:
    10/03/09 15:15:54 INFO  [javascript] Executing File: \\Server_IP_Address\JavaScript_File_Path\JavaScript_File.js
    10/03/09 15:16:01 ERROR [link manager] Link missing.; file:C:/help.gif
    10/03/09 15:16:01 ERROR [link manager] Link missing.; file:C:/Documents%20and%20Settings/All%20Users/Documents/My%20Pictures/Sample%20Pictures/ Water%20lilies.jpg
    10/03/09 15:16:01 ERROR [link manager] Link missing.; file:C:/Documents%20and%20Settings/All%20Users/Documents/My%20Pictures/Sample%20Pictures/ Winter.jpg
    Following is the java-script that is being used for replacing image from indd's frame:
    var myDocument = app.open(File('//Server_IP_Address/InDesignDocument_File_Path/Sample.indd'));
    var tmp_frmid="1339"; //frame id of which image needs to be replaced.
    for (var i=0;i<myDocument.pages.length;i++)
    var objPage=myDocument.pages.item(i);
    var objPageitems = objPage.pageItems;
    try
    var obj = objPageitems.itemByID(tmp_frmid);
    obj.images[0].remove;
    obj.appliedObjectStyle = null;
    var myImage=obj.place(File('//Server_IP_Address/Images_to_be_reolaced_Path/ImageFile.jpg'));
    var old_height = myImage.geometricBounds[2] - myImage.geometricBounds[0];
    var new_height = obj.geometricBounds[2] - obj.geometricBounds[0];
    var old_width = myImage.geometricBounds[3] - myImage.geometricBounds[1];
    var new_width = obj.geometricBounds[1] + ((new_height / old_height) * old_width);
    myImage.geometricBounds = [obj.geometricBounds[0] + "mm", obj.geometricBounds[1] + "mm", obj.geometricBounds[2] + "mm", new_width + "mm"];
    var diff = obj.geometricBounds[1] - myImage.geometricBounds[1];
    myImage.move( undefined, [diff,0] );
    break;
    catch(e)
    myDocument.save('//Server_IP_Address/InDesignDocument_File_Path/Sample.indd');
    var previewFile = File('//Server_IP_Address/Images_to_be_reolaced_Path/ImageFile.jpg');
    app.jpegExportPreferences.jpegQuality["JPEGOptionsQuality.low"];
    app.documents.item(0).exportFile(ExportFormat.jpg, previewFile);
    myDocument.close();
    I have very urgent requirement; if anyone have any idea; please suggest me. \
    It would be highly appreciable.
    Kind Regards,
    Prashant.

    http://www.automatication.com/selection-to-pdf-script.html
    Harbs
    http://www.in-tools.com

  • Script for Inactive computer from last logon time stamp

    Hi Freinds,
    I have a list of servers which include some specific servers (around 900 servers). now i need to check those servers which are not logged on from last 30 or 60 days. 
    I find the scripts which run against AD and list the servers but here i need to check from the specific servers. 
    I know this is possible but not sure how it can be. Please Help 
    Thanks.
    Anjani Kumar

    Hi Anjani,
    you really might want to try learning Powershell for yourself, if you have to manage hundreds of servers. That said, there are some fairly simple and obvious tools, with which you can do this:
    "Get-Content" gets contents from text files and stores it line by line into an array. Maybe a list of those servers?
    "foreach" allows you to loop through each item in an array and do something with the item.
    "Get-ADComputer" searches for computers in an AD. You can filter which computer-object you get (say - only get a computer that is named thus ...).
    If you have any questions about these commands, asking the powershell might help you (Example: Get-Help Get-Content -Detailed).
    Cheers,
    Fred
    There's no place like 127.0.0.1

  • Is there a shortcut for moving playhead precisely in a clip

    Is there a shortcut to move the play head precisely in a clip? For instance 1 second forward from beginning of clip -- or 1 second back from end of clip?
    I want to insert key frames for fades and zooms. thanks.

    Sean:
    In your timeline, and nothing selected, place the playhead in the reference location (in your example, at the beginning of your clip) and just type the desired playhead "movement": i.e. type 10 + ENTER and your playhead will move 10 frames forward. You can use seconds too: i.e. typing -1.15 will move your pleyhead 1:15 secs. backwards.
    Hope it helps !
      Alberto

  • Script for moving & deleting files

    Hi
    I'm quite new to scripts & looking for a script to move selected files with time-stamp & also a script to delete selected file/s in a directory. Below is an example of my requirement
    Move
    Ex:  c:\work\source\test.txt to c:\work\target\test.txt_04202015022100
    Delete
    Ex: c:\work\target\test-1.txt
    Could someone help me please.
    Thank very much
    Neil

    This forum is for scripting questions rather than script requests.
    Please start by reading the following:
    Posting guidelines
    Handy tips for posting to this forum
    How to ask questions in a technical forum
    Rubber duck problem solving
    How to write a bad forum post
    Help Vampires: A Spotter's Guide
    -- Bill Stewart [Bill_Stewart]

  • Moving playhead by keyboard

    When I want to move my playhead 5 frames foreward, I type +5 at the nummeric keyboard.
    For moving playhead 5 seconds, I type +5. at nummeric keyboard.
    Question: What should I type for jumping 5 minutes forward?
    Thnks

    +5.00

  • Help Scripting for PDF Form List Box

    I am attempting to write JavaScript for an Adobe Acrobat X Pro form. I would like to set an action script for a List Box titled "customer_name" so that when a specific customer name is selected, a corresponding text box titled "cutomer_number" will automatically fill with the correct number. I am not very familiar with JavaScript so any help would be greatly appreciated.

    The easiest way to do this is to set the export value of each list box item to the corresponding customer number. The script for the custom number field could then simply be:
    // Set this field's value to the export value of the selected item in the list box
    event.value = getField("customer_name").valueAsString;
    Post again if you don't want to set up the list box that way for some reason since there are other ways to deal with this.

  • Script for gathering AD Group Membership data

    I have been looking for a script that will gather the users from a specific AD Group and display the SamAccountName, Name, and e-mail address of the user. Any ideas? I can get the data using LDAP query in AD, but have yet to develop the script to execute
    it from Powershell and then export it to a csv file. Thank You!

    I'd suggest checking out the Gallery. I found this script there that seems like it would fit your needs.
    https://gallery.technet.microsoft.com/Get-a-list-of-all-Security-84dfb7ac
    Here's the search I ran if you want to look for others.
    https://gallery.technet.microsoft.com/site/search?query=list%20active%20directory%20groups%20and%20members&f%5B0%5D.Value=list%20active%20directory%20groups%20and%20members&f%5B0%5D.Type=SearchText&ac=5

Maybe you are looking for

  • The New Adobe CC

    I'd just like to make a remark (and possibly open the floor to discussion) that I've been reading a lot of grief about Adobe's move to CC. I've recently experienced a spat of CC syncing outages as well as missing files as Adobe attempts to collect th

  • How to use j_security_check

    Hi, I am using j_security_check servlet to set up Form authentication for my simple web app in WebSphere 5.1. The web app is simple, and only contains login.jsp and error.jsp. I also include a servlet in this web app and it's a protected resource. Cu

  • Address book doesn't sync with Outlook 2011 for mac since installing Lion OSX.

    Neither automatically nor manually.  Can anyone help please?

  • Enterprise Manager Oracle 9i

    When I do select username from dba_users; on SQLPLUS The schema that I want is there but on OEM it's not there. How do I retrieve it. Thanx.

  • How do I stop the Keychains folder from randomly deleting?

    For some reason ~/library/keychains keeps randomly deleting. A Quick About Me: I'm a computer technician, and I'm just completely baffled as to why this is happening. Yes, I've tried all the obvious things (not in this order, of course); Resetting PR