Handy dandy little script for counting frames

I have this little jsfl script which came from one of the
contributors to
this NG, works a treat for telling me exactly how many frames
I have
selected at a time, heavensent for "paste frames", a wonder
why Adobe never
incorporated such a thing into the interface.
Anyway it worked fine in Flash 8 - I just dropped it into
"\en\First
Run\Commands" folder and up it pops in my Command Menu. It
doesn't happen in
CS3 though. It still works if I launch it manually while
running Flash, but
they must have done something to the DOM that prevents it
from showing in
the menu.
Can anybody help me out with that? Here is the script:
var current_tl = fl.getDocumentDOM().getTimeline();
var selectedFrames = current_tl.getSelectedFrames();
var selectedRegions = selectedFrames.length/3;
fl.outputPanel.clear();
fl.trace('Selected Regions: '+selectedRegions);
var count = 0;
while(selectedFrames.length){
count++;
var region = selectedFrames.splice(0,3);
fl.trace(' -Region '+count+':');
fl.trace(' First Frame: '+(region[1]+1));
fl.trace(' Last Frame: '+(region[2]));
fl.trace(' Selection Span: '+(region[2]-region[1]));

Ok - I just figured it out. It all goes in Local Settings:
\Local
Settings\Application Data\Adobe\Flash
CS3\en\Configuration\Commands
"Stephen C" <[email protected]>
wrote in message
news:f20vpb$fv3$[email protected]..
>I have this little jsfl script which came from one of the
contributors to
>this NG, works a treat for telling me exactly how many
frames I have
>selected at a time, heavensent for "paste frames", a
wonder why Adobe never
>incorporated such a thing into the interface.
>
> Anyway it worked fine in Flash 8 - I just dropped it
into "\en\First
> Run\Commands" folder and up it pops in my Command Menu.
It doesn't happen
> in CS3 though. It still works if I launch it manually
while running Flash,
> but they must have done something to the DOM that
prevents it from showing
> in the menu.
>
> Can anybody help me out with that? Here is the script:
>
> var current_tl = fl.getDocumentDOM().getTimeline();
> var selectedFrames = current_tl.getSelectedFrames();
> var selectedRegions = selectedFrames.length/3;
> fl.outputPanel.clear();
> fl.trace('Selected Regions: '+selectedRegions);
> var count = 0;
> while(selectedFrames.length){
> count++;
> var region = selectedFrames.splice(0,3);
> fl.trace(' -Region '+count+':');
> fl.trace(' First Frame: '+(region[1]+1));
> fl.trace(' Last Frame: '+(region[2]));
> fl.trace(' Selection Span: '+(region[2]-region[1]));
> }
>
>

Similar Messages

  • Tv-star.sh, a little script for managing tv.

    Hi altogether!
    I wanted a very small app to watch and record tv with my dvb-t stick, so I created tv-star.sh:
    #!/bin/bash
    # Befor you start, you need to edit the 2
    # variables SCANBASE and MOVIEFOLDER
    # This is the base-file for the frequency-scan.
    # Chose the one corresponding to your location.
    SCANBASE="/usr/share/dvb/dvb-t/de-Schleswig-Holstein"
    # Folder where the movies are stored.
    # IMPORTANT: Use the full path, don't use ~ for your home!
    # Example:
    # MOVIEFOLDER="/home/tux/tv/"
    MOVIEFOLDER=""
    echo -e "\n***********************************"
    echo "*** tv-star 0.5 ***"
    echo "*** by Thomas Schuetz ***"
    echo "***********************************"
    MAINLOOP=1
    if [ "$MOVIEFOLDER" == "" ]; then
    MAINLOOP=0
    echo -e "\nYou need to edit the variables SCANBASE and MOVIEFOLDER in the top of the script before you can use it.\n"
    fi
    while [ ${MAINLOOP} -gt 0 ]; do
    echo -e "\n"
    echo "1) Watch TV"
    echo "2) Record a movie"
    echo "3) Cancel the record of a movie"
    echo "4) Watch recorded movie"
    echo "5) Delete recorded movie"
    echo "8) Show informationen about tv-star.sh"
    echo "9) Create new channel.conf"
    echo "0) Quit"
    echo -e -n "\nYour choice: "
    read INPUT
    echo -e "\n"
    case $INPUT in
    1) echo "Please chose the station you want to watch:"
    NUMBER=0
    for LINE in `cat ~/.mplayer/channels.conf | sed s/:.*//`; do
    NUMBER=$((NUMBER+1))
    echo -n ${NUMBER}") "
    echo ${LINE};
    done
    echo -e -n "\nYour choice: "
    read STATION
    STATIONNAME=`tail -n +$STATION ~/.mplayer/channels.conf | head -n 1 | sed s/:.*//`
    mplayer dvb://${STATIONNAME}
    2) echo "Please chose the station where you want to record a movie:"
    NUMBER=0
    for LINE in `cat ~/.mplayer/channels.conf | sed s/:.*//`; do
    NUMBER=$((NUMBER+1))
    echo -n ${NUMBER}") "
    echo ${LINE};
    done
    echo -e -n "\nYour choice: "
    read STATION
    RECORDSTATION=`tail -n +${STATION} ~/.mplayer/channels.conf | head -n 1 | sed s/:.*//`
    echo -e -n "\nWhen do you want to start the record (Format: 20:15)? "
    read RECORDSTART
    echo -e -n "\nWhen do you want to end the record (Format: 22:00)? "
    read RECORDEND
    echo -e -n "\nHow should the file be named? "
    read RECORDFILE
    echo "mplayer -quiet dvb://${RECORDSTATION} -dumpstream -dumpfile ${MOVIEFOLDER}${RECORDFILE}" | at ${RECORDSTART}
    echo "killall mplayer" | at ${RECORDEND}
    echo
    3) echo "Available at-jobs:"
    atq
    echo "I will always cancel the start- and the end-job, please only enter the number of the start-job (the one with the lower number)!"
    echo -e -n "\nWhich job do you want to cancel (0 = none): "
    read JOB
    if [ ${JOB} -gt 0 ]; then
    atrm ${JOB}
    KILLJOB=$((${JOB}+1))
    atrm ${KILLJOB}
    fi
    4) echo "Recorded movies:"
    NUMBER=0
    for LINE in `ls ${MOVIEFOLDER}`; do
    NUMBER=$((NUMBER+1))
    echo -n ${NUMBER}") "
    echo ${LINE};
    done
    echo -e -n "\nWhich movie do you want to watch (0 = none): "
    read MOVIEFOLDERNUMBER
    NUMBER=0
    if [ ${MOVIEFOLDERNUMBER} -gt 0 ]; then
    for LINE in `ls ${MOVIEFOLDER}`; do
    NUMBER=$((NUMBER+1))
    if [ $((NUMBER)) == $((MOVIEFOLDERNUMBER)) ]; then
    MOVIEFOLDERNAME=${LINE}
    fi
    done
    mplayer ${MOVIEFOLDER}${MOVIEFOLDERNAME}
    fi
    5) echo "Recorded movies:"
    NUMBER=0
    for LINE in `ls ${MOVIEFOLDER}`; do
    NUMBER=$((NUMBER+1))
    echo -n ${NUMBER}") "
    echo ${LINE};
    done
    echo -e -n "\nWhich movie do you want to delet (0 = none): "
    read MOVIEFOLDERNUMBER
    NUMBER=0
    if [ ${MOVIEFOLDERNUMBER} -gt 0 ]; then
    for LINE in `ls ${MOVIEFOLDER}`; do
    NUMBER=$((NUMBER+1))
    if [ $((NUMBER)) == $((MOVIEFOLDERNUMBER)) ]; then
    MOVIEFOLDERNAME=${LINE}
    fi
    done
    rm -i ${MOVIEFOLDER}${MOVIEFOLDERNAME}
    fi
    8) echo "About tv-star.sh 0.5 by Thomas Schuetz, 2011-08-27:"
    echo "---------------------------------------------------"
    echo -n "There are great mediacenter-projects like MythTV, but they are too big for "
    echo -n "my simple needs. In fact, you only need one single line to record a movie, "
    echo -n "but I was too lazy to type the long line always by myself, so I created this "
    echo "little script and put everything in it, I need for handling tv."
    echo -n "The script itself is very simple, it only needs mplayer, the scan-command "
    echo -n "from the dvb-apps and some standard shell-commands. Before you really use it, "
    echo "you need to edit the variables SCANBASE and MOVIEFOLDER in the top of the script."
    9) echo -e "Creating a new channel.conf, please wait a while!\n"
    rm -f ~/.mplayer/channels.conf.old
    mv ~/.mplayer/channels.conf ~/.mplayer/channels.conf.old
    scan $SCANBASE | sed -e 's/\ /_/g' -e 's/\//_/g' -e 's/\*//' > ~/.mplayer/channels.conf
    0) echo -e "Thank you for using tv-star.sh!\n"
    MAINLOOP=0
    *) echo -e "Wrong input, please chose again!\n"
    esac
    done
    I am no programmer, so if you have any ideas how I can make the script better, please tell me!

    Some improvements:
    diff --git a/tv-star.sh b/tv-star.sh
    index a9b6666..3bfe603 100644
    --- a/tv-star.sh
    +++ b/tv-star.sh
    @@ -8,25 +8,16 @@
    SCANBASE="/usr/share/dvb/dvb-t/de-Schleswig-Holstein"
    # Folder where the movies are stored.
    -# IMPORTANT: Use the full path, don't use ~ for your home!
    -# Example:
    -# MOVIEFOLDER="/home/tux/tv/"
    -MOVIEFOLDER=""
    +MOVIEFOLDER=~/tv/
    +mkdir -p $MOVIEFOLDER
    -echo -e "\n***********************************"
    +echo
    +echo "***********************************"
    echo "*** tv-star 0.5 ***"
    echo "*** by Thomas Schuetz ***"
    echo "***********************************"
    -MAINLOOP=1
    -if [ "$MOVIEFOLDER" == "" ]; then
    - MAINLOOP=0
    - echo -e "\nYou need to edit the variables SCANBASE and MOVIEFOLDER in the top of the script before you can use it.\n"
    -fi
    -while [ ${MAINLOOP} -gt 0 ]; do
    +while :; do
    echo -e "\n"
    echo "1) Watch TV"
    echo "2) Record a movie"
    @@ -40,7 +31,7 @@ while [ ${MAINLOOP} -gt 0 ]; do
    read INPUT
    echo -e "\n"
    case $INPUT in
    - 1) echo "Please chose the station you want to watch:"
    + 1) echo "Please choose the station you want to watch:"
    NUMBER=0
    for LINE in `cat ~/.mplayer/channels.conf | sed s/:.*//`; do
    NUMBER=$((NUMBER+1))
    @@ -139,9 +130,9 @@ while [ ${MAINLOOP} -gt 0 ]; do
    scan $SCANBASE | sed -e 's/\ /_/g' -e 's/\//_/g' -e 's/\*//' > ~/.mplayer/channels.conf
    0) echo -e "Thank you for using tv-star.sh!\n"
    - MAINLOOP=0
    + break
    *) echo -e "Wrong input, please chose again!\n"
    esac
    Last edited by JohannesSM64 (2011-08-27 08:30:45)

  • EBS script for counting used licenses

    Hello,
    I'm looking for a script to execute on the database aimed at telling me how many licenses are actually used on my EBS.
    As part of an internal audit on licenses, I need to compare what we use in EBS with what we have bought.
    Concerning what we have bought, I have all the contracts.
    Concerning what we use, i'm looking for a method to determine the exact count.
    Ideally, I was wondering if a database script could exist, regarding that all users, employees and so on are stored in the EBS database.
    I was also wondering if a documentation exists.
    Many thanks.

    Hi,
    you can use this,
    REM:**********************************************************************************************
    REM: Script SCRIPT FOR User Informations
    REM: NOTE: PLEASE TEST THIS SCRIPT BEFORE USE.
    REM: Author will not be responsible for any damage that may be cause by this script.
    set feedback off
    set termout on
    set pagesize 56
    set linesize 800
    ttitle off
    spool D:\userinfo.wri
    set verify off
    set heading on
    Prompt Database Name:
    select 'Database Name (SID): ' || name "name" from v$database;
    prompt
    prompt
    prompt Database Version Informations:
    select * from v$version;
    select username,profile,default_tablespace,temporary_tablespace from dba_users;
    Prompt Database Character Set Informations:
    select * from nls_database_parameters;
    Prompt Database Segment Managment Informations:
    select TABLESPACE_NAME,BLOCK_SIZE,EXTENT_MANAGEMENT,SEGMENT_SPACE_MANAGEMENT from dba_tablespaces;
    Prompt Database Object Informations:
    select owner,object_type,count(1) from dba_objects Where owner not IN ('SYS','MDSYS','CTXSYS','HR','ORDSYS','OE','ODM_MTR','WMSYS','XDB','QS_WS', 'RMAN','SCOTT','QS_ADM','QS_CBADM',
    'ORDSYS','OUTLN','PM','QS_OS','QS_ES','ODM','OLAPSYS','WKSYS','SH','SYSTEM','ORDPLUGINS','QS','QS_CS') group by owner,object_type order by owner;
    Prompt File and Tablespace Informations:
    SELECT file_name,tablespace_name,autoextensible,maxbytes/1048576 FROM dba_data_files;
    spool off
    Hope it help.

  • Action Script for next frame

    Hi,
    I'm making an interactive world map.
    The idea is that the mouse rolls over a country which makes
    the country goes red and the countries name appears. I have got
    this to work fine, but I am trying to use some script so that when
    the mouse clicks down and releases on the country, another screen
    appears which is a screen with information about the country (the
    original screen needs to disappear - it's not a box of text which
    will appear but a whole new screen)
    Can anyone advise? I have tried to use a basic 'on release go
    to' script but it doesn't work.
    Thanks very much.

    Thanks, I've got this to work now, but when it advances to
    the next frame it keeps looping back to the first frame. I've tried
    using stop() on the frame I am advancing to, gotoandStop(2) in the
    first frame and a few other things I have found in the looping
    problem threads on this forum. I'm publishing as a flash movie not
    HTML.
    Any thoughts?

  • Little script for less AAARGH

    I wanted to advertise a small script (it's from debian - hey, don't stop reading here!) that might save you an AAAARGH one day It asks for the hostname if you invoke any shutdown/reboot command via ssh, for when you might be a bit sleepy.
    http://aur.archlinux.org:80/packages.php?ID=24349

    fukawi2 wrote:I thought WIN... That's perfect... Then I decided to test it on my live server... Perhaps this should go in to the Stupidest Computing Mistakes thread
    Read the install notice

  • Program (PL/SQL) for count the registers of all tables in a schema

    Hi...
    I create a little program , for count the registers of all tables in the schema...
    If you need , send me your email...
    Atte
    Hector

    Hi,
    You can create a script by yourself by executing the script mentioned below:
    Connect as sys or system....
    SQL> spool test.sql
    SQL> select 'select count(*) from '||owner||'.'||table_name||';' from dba_tables;
    SQL> spool off;
    Hope this helps.
    Regards,
    -Praveen.
    http://myracle.wordpress.com

  • Script for Member Count in list of Distribution List

    Hi All,
    Would like to see your help in some powershell scripting. I am still a newbie in scripting for Exchange 2010 (Office 365). I am tasked to write a script that will count how many members in a list of distribution list. I have manage to come up with most of
    the task, but I am not able to get the count. The error says Object not found. Below is my simple script. Hope someone can help me to see where are my mistakes in the script. This is how my script works, 
    1. Generates a TXT file for the list of DLs
    2. Get reads the TXT file and generates the user counts for each DL in the TXT file.
    3. Output the results into a CSV file.
    Get-DistributionGroup -Identity DL-ATD* | Select-Object DisplayName > DL.txt
    $data = @()
    $dls = get-content DL.txt
    foreach ($dl in $dls) {
     $data += New-Object -TypeName PSObject -Property @{
      DisplayName = $dl
      Count = (Get-DistributionGroupMember -Identity  $dl  | Measure-Object).Count
    $data | Export-Csv -Path mydllist.csv -NoTypeInformation
    Thanks in advance.

    Hi,
    Thanks for the scripts, but the scripts mentioned are searching for all the DL which are available in the server. Is there a way I can look for like selected ones, for example any DL that starts with DL-ATD.xxxxx.
    Thanks.

  • Pushing Frame Scripts for Animation into Classes

    I would like to move some scripts that are on frames of an
    animation to a class. I'm wondering if there are some best
    practices for this. The animation that I have includes scripts on
    individual frames. These include the common stop, gotoAndPlay etc.
    These scripts execute as the animation runs. I'm not sure how I can
    do the same in a class. Maybe the best thing to do is to use
    onEnterFrame and check for frame numbers using a conditional. Seems
    sort of awkward. I don't know of any ready way to make a event
    listener for a frame event. That would seem ideal.

    Why impatient? I'd really like to find out what's going on.
    The nature of what I'm doing requires that I get control of how and
    why things play when they play. For examle, why should it play
    differently to daisyChain loadMovie as opposed to chaining
    gotoAndPlay("scene", 1)?
    I'd also then need a preloader to insure all movies were
    ready or the animation would pause. I'll keep playing at it.
    Thanks for trying.

  • Command-line -t frameRange wildcard for all frames?

    Greetings,
    Pretty new to Shake and I am trying to get a seemingly simple command-line workflow going. I have a patch of QT files I need to output as DPXs after being deinterlaced. Where I am getting hung up is with the frameRange. It seems it will only render the first frame unless I give a range. Since I don't know how many frames each individual MOV has, I am getting stumpped. Is there a wildcard or some other option for having shake just do the whole thing?
    Here's my command-line:
    *shake -v -fi 0003PU.mov -deinterlace 0 1 -fo 0003PU_DPX/0003PU.#.dpx*
    I have >80 QT files to convert to DPX, it seems a waste of time to have to open each one in the Shake GUI to find out the total frame count for each one. In the GUI it has the "Auto" button which populates the timeRange field with the full range, surely there must be something I can do from the command-line!

    I wish there were such a wildcard! That would make life so easy.
    I did figure out a way to generate Shake scripts automatically,
    including finding the length of the source file. It will take a little
    work: you'll have to learn bash.
    Basically bash is a way of taking a bunch of command lines,
    and combining them into something you can run as a program.
    Here are two excellent resources for learning:
    http://www.ibm.com/developerworks/library/l-bash.html
    http://www.grymoire.com/Unix/
    These two sites are awesome.
    __________EXAMPLE ONE
    Every bash script includes this line:
    #!/bin/sh
    Then you just start adding UNIX and/or bash commands.
    So copy these two lines into a plain text editor window
    and save them as amnesia.sh
    #!/bin/sh
    whoami
    In Terminal you can run your new program!
    Use cd to navigate to where amnesia.sh is,
    and type
    bash amnesia.sh
    You will be reminded of your identity.
    __________EXAMPLE TWO
    Jumping ahead really quickly, here's a technique for
    making a loop that will call up the name of
    every Quicktime movie in a folder and send
    it to some function in your bash script:
    cd ./folder_containing_movies
    for i in $(find . -name '*.mov');
    do
    my_fi=`basename $i`
    my_function $my_fi
    done
    __________EXAMPLE THREE
    Now we'll define that function: it prints out the name of the movie.
    This part of the script must be above the loop
    from which it is called.
    So here's the complete bash script:
    #!/bin/sh
    my_function ( )
    echo $my_fi
    cd ./folder_containing_movies
    for i in $(find . -name '*.mov');
    do
    my_fi=`basename $i`
    my_function $my_fi
    done
    __________EXAMPLE FOUR
    In order to have shake do something with these movies,
    you could, in the example above, replace
    echo $my_fi
    with
    shake $my_fi
    but then you'd just get the first frame, and you'd
    have to quit each Viewer to see the next movie.
    For normal fully-tweaked dozens-of-nodes Shaking, one would use
    shake -exec my_script.shk
    The problem is that it's difficult (impossible?) to pass variables
    like my_fi into my_script.shk. I was unable to do it--
    probably because I'm just a beginner--
    so I used bash to replace key words in a template,
    scriptTemplate.shk, to write one shake script for each movie.
    To do this, you need to replace parameters in the Shake script
    with words that can be searched and replaced. In your Shake
    template, the FileIn filename can be something like SEDmy_fi.
    In bash you can use the sed command to search and replace
    the expressions in the template:
    sed -e 's/SEDmy_fi/'$my_fi'/g' scriptTemplate.shk > ./scripts_out/${my_fo}.shk
    This does the search and replace, then writes a shake script
    named automatically by my_fo, another variable you've created:
    my_fo=`echo $my_fi | sed 's/.mov/_output/'`
    __________EXAMPLE FIVE
    At this point your head is totally spinning. Don't worry.
    This is not a tutorial; I'm just trying to sketch out
    the broad ideas here. You'll still have to learn bash
    for this to make sense.
    As a special bonus, here's a really useful bash command I stole from Olli
    at vfxtalk.com to get the timerange of a movie using shake -info :
    timerange=`shake ./folder_containing_movies/$my_fi -info 2>&1 | grep Duration | sed 's/info: Duration: //'`
    You could then use $timerange elsewhere in your bash script.
    Hope that helps,
    Les

  • Script for batch delet redundant layer

    I have thousands files in the different folders, each file has same layer named “Job Info”. Can someone help me to write a script for del this layer folder by folder?
    I expected the script tells me that I have to select a folder, then it can automatically open the files, del “job info” layer then save file, rewrite, close file

    Hi Ashram,
    Sorry, I misunderstood your question. Please try the below.
    var folder = Folder.selectDialog ("Select the root folder");
    var myfiles = [];
    var _layers = ["test1", "test2", "test3"];
    getsubfolderfiles(folder);
    for(var i =0;i<myfiles.length;i++)
            var doc = app.open(myfiles[i],false);
            for(var j=0;j<_layers.length;j++)
                try
                    app.activeDocument.layers.add({name:_layers[j]})
                catch(e){}
            doc.save();
            doc.close();
    function getsubfolderfiles(folder)
        var filelist = folder.getFiles();
        for(var i =0;i<filelist.length;i++)
            if(filelist[i] instanceof Folder)
                getsubfolderfiles (filelist[i]);
            else if(filelist[i] instanceof File)
                if(filelist[i].name.indexOf(".indd") > -1){
                    myfiles.push(filelist[i]);
    Hi HarveyLiu,
    Try this,
    var folder = Folder.selectDialog ("Select the root folder");
    var myfiles = [];
    getsubfolderfiles(folder);
    for(var i =0;i<myfiles.length;i++)
            var doc = app.open(myfiles[i],false);
            try{
                var _layer = doc.layers.item("Job Info");
                _layer.remove();
                var link, image, frame,
                links = doc.links, counter = 0;
                for (var i = links.length-1; i >= 0; i--) {
                    if (links[i].status == LinkStatus.LINK_MISSING) {
                        try {
                            link = links[i];
                            image = link.parent;
                            frame = image.parent;
                            frame.remove();
                            counter++;
                        catch (err) {
                            $.writeln(i + " - " + err);
            catch(e){}
            doc.save();
            doc.close();
    function getsubfolderfiles(folder)
        var filelist = folder.getFiles();
        for(var i =0;i<filelist.length;i++)
            if(filelist[i] instanceof Folder)
                getsubfolderfiles (filelist[i]);
            else if(filelist[i] instanceof File)
                if(filelist[i].name.indexOf(".indd") > -1){
                    myfiles.push(filelist[i]);
    Regards,
    Chinna

  • Script for shrinking overset text?

    I use data merge to create labels for guests attending functions. Usually this is around 500-1000 labels at one time. I usually set my text frame on the template page for a large point and then shrink it horizontally (I do this to minimize the number of pages I have to manually edit for overset text). I still get some names where they are long hyphenated names that create overset text.
    Is there a script available where it will recognize there is overset text and then shrink the text down either by decreasing the point size or adjusting the horizontal spread of the text (maybe making it 100% to 80%)?

    Hi,
    You could try this:
    #target indesign
    myDoc = app.activeDocument;
    var textArr = new Array(), mRes, myPit, count, done;
    mFramesToMove = new Array();
    myPit = myDoc.allPageItems;    // array with doc pageItems (masterpages and groups included)
    for (var k = 0; k < myPit.length; k++)
        if (myPit[k].constructor.name == "TextFrame" && myPit[k].overflows )
        textArr.push(myPit[k]);    // array with overset textFrames
    count = textArr.length;
    if (count) mRes = mDialog (count);
    else {alert ("No overset texts found"); exit (); }
    for (var i = 0; i < textArr.length; i++) {
        done = mShrink (textArr[i], mRes);
        if (!done[0] ) {
            alert (done[1] + "\rFill a dialog field with a number");
            exit; }
        if (mFramesToMove.length) {
            if (myDoc.layers.item("Overset frames").isValid)
                mLayer = myDoc.layers.item("Overset frames");
            else
                mLayer = myDoc.layers.add({LocationOptions: LocationOptions.AT_BEGINNING, name: "Overset frames"});
            for (var i = 0; i < mFramesToMove.length; i++)
            mFramesToMove[i].itemLayer = mLayer;
            alert ("Some frames (" + mFramesToMove.length + ") stay overset\rTake a look at layer 'Overset Frames' ");
        else alert (count + " frames overset fixed");
    function mDialog (number) {// "What to do" dialog
        var w = new Window("dialog","What to do?", undefined, {closeButton: false});
        w.add ("statictext", undefined, "Number of overset texts found:  " + number.toString() );
        var myTop = w.add ("panel");
        myTop.alignment = "left";
        myTop.orientation = "row";
        var myCheckBx = myTop.add ("group");
        myCheckBx.orientation = "column";
        myCheckBx.alignChildren = "left";
        var Ch1 = myCheckBx.add("checkbox", undefined, "point size limit: ");
        var Ch2 = myCheckBx.add("checkbox", undefined, "hori scale limit: ");
        var myEditBx = myTop.add ("group");
        myEditBx.orientation = "column";
        var Ed1 = myEditBx.add("edittext", undefined, undefined);
        Ed1.enabled = false; Ed1.characters = 4;
        var Ed2 = myEditBx.add("edittext", undefined, undefined);
        Ed2.enabled = false; Ed2.characters = 4;
        Ch1.onClick = function () {
            if (Ch1.value) Ed1.enabled = true;
            else Ed1.enabled = false;}
        Ch2.onClick = function () {
            if (Ch2.value) Ed2.enabled = true;
            else Ed2.enabled = false;}
        var myStatBx = myTop.add ("group");
        myStatBx.orientation = "column";
        myStatBx.add("statictext", undefined, " pt");
        myStatBx.add("statictext", undefined, " %");
        var b = w.add ("group");
            b.add ("button", undefined, "OK", {name: "ok"});
            b.add ("button", undefined, "Anuluj", {name: "cancel"});
        if (w.show() == 1)
            return [Ch1.value, Ed1.text, Ch2.value, Ed2.text];
        else exit();
    function mShrink (textFr, ToDoArr) {    // input textFrame and array with mDialog result
        var pSizeLimAc, pSizeLim, pSizeCurr, pSizeDiff, pSizeStepN, pSizeStep,
            hScaleAc, hScaleLim, hScaleCurr, hScaleDiff, hScaleStepN, hScaleStep,
            ToDo;
        pSizeLimAc = ToDoArr[0];
        hScaleAc = ToDoArr[2];
        pSizeLim = ToDoArr[1];
        if (pSizeLimAc) {
            if (isNaN (parseFloat(pSizeLim) ) ) return [false, "point size is not a number"];
            else pSizeLim = parseFloat(pSizeLim);
            pSizeCurr = textFr.parentStory.pointSize;
            pSizeDiff = pSizeCurr - pSizeLim;
            pSizeStepN = pSizeDiff / 0.1;
            pSizeStep = 0.1;
        hScaleLim = ToDoArr[3];
        if (hScaleAc) {
            if (isNaN (parseFloat(hScaleLim) ) ) return [false, "hori scale is not a number"];
            else hScaleLim = parseFloat(hScaleLim);
            hScaleCurr = textFr.parentStory.horizontalScale;
            hScaleDiff = hScaleCurr - hScaleLim;
            if (pSizeLimAc) hScaleStepN = pSizeStepN;
            else hScaleStepN = hScaleDiff;
            hScaleStep = Math.round(hScaleDiff/hScaleStepN*10)/10;
        if (!(hScaleDiff > 0) ) hScaleAc = false;
        if (!(pSizeDiff > 0) ) pSizeLimAc = false;
        if (pSizeLimAc && hScaleAc) ToDo = 3;
        else if (pSizeLimAc) ToDo = 1;
            else if (hScaleAc) ToDo = 2;
                else ToDo = 0;
        switch (ToDo) {
            case 1: {
                while (pSizeStepN-- && textFr.overflows)
                    textFr.parentStory.pointSize -= pSizeStep;
                    break; }
            case 2: {
                while (hScaleStepN-- && textFr.overflows)
                    textFr.parentStory.horizontalScale -= hScaleStep;
                    break; }
            case 3: {
                while (hScaleStepN-- && textFr.overflows)
                    textFr.parentStory.pointSize -= pSizeStep;
                    textFr.parentStory.horizontalScale -= hScaleStep;
                    break; }
            default: break;
        if (textFr.overflows) mFramesToMove.push(textFr);
        return [true];
    User will be asked for pointSize and horizontalScale lower limit.
    rgds

  • SAP Screen Personas problem in a script for FS00(G/L Account Display) screen

    We are facing a problem when we are developing a simple script for FS00(G/L Account Display) in SAP Screen Personas. Let me give you a brief of the problem:
    We have taken two text fields in the dashboard from which the values will be copied and will be pasted in corresponding text fields of G/L Account and Company Code in FS00 TCode.
    When we are giving both the values, then script is working fine and it will navigate to the customized Personas screen where all the details are shown.
    But when we are leaving any one/both fields blank and execute the script option, then the pop to enter G/L Account/Company Code is coming:
    If we are setting the basic FS00 TCode view as default then after the pop-up we are able to enter the respective G/L account number or company code and everything is running fine.
    If we are setting our customized personas screen as default screen, then the pop-up keeps on appearing and therefore we are not able to give the inputs (G/L account or company code).
    And even if somehow manage to get rid of the error and enter the correct GL account and Company Code then also the details are not displayed. The F4 search help to pick the G/L account number and company code is not working, somehow the Personas screen seems to be locked here.
    Please let us know if someone has already encountered this type of situation before and what should be the solution of this.

    Hi,
    You could ensure that both of the text fields are not empty on your 'dashboard' before executing the FS00 tcode. This would negate the popup from ever appearing.
    To do this you can use the "IF <text field control ID> Is Empty" statement in your script and then output a custom error message to another text box if the condition is true. then use an "IF <text field control ID> Is NOT Empty" statement to copy the value/s execute the FS00 tcode if the condition is true.
    Now if you're going to check multiple fields for entries before executing the FS00 you'll have to get a little more creative and do something like I did in one my scripts (thanks again to Steve Rumsby for the tips) and create a 'check field' where you can enter values for items checked successfully and then use a little bit of javascript to count up the checks and check the result before executing the next part of the script.
    Another idea is to check for the existence of the popup and navigate past it in your script, to do this you can use the "IF <control ID> control exists" statement.
    Either one should work.

  • One script for multiple loaded movie clips

    Hello,
    I am sure that this has been asked or answered before, but
    could not locate the correct response.
    Problem:
    There are 20 movie clips loaded onto the stage through
    actionscript. I have 20 different onPress scripts to start the drag
    for each (which also contain custom variable).
    Problem, I have one single onRelease script which is to be
    used for each, but do now wish to give 20 custom handled scripts.
    Can I somehow use certain scripting for using one single
    generic script for the onRelease? So no matter what was released it
    will go through this one script.
    Thanks
    D

    like this...
    activate
    set the_folder to choose folder with prompt "Select the folder you want to add folders to..."
    tell application "Finder"
    set the_name to "Name"
    set the_count to 3
    repeat with this_num from 1 to the_count
    set new_num to this_num as string
    if (count new_num) is 1 then set new_num to "0" & new_num
    make new folder at the_folder with properties {name:the_name & " " & new_num}
    end repeat
    end tell

  • A simple script for you, a giant script for me-

    I like scripts very much but scripting does not seems to like me! Can anyone help me and write a script for me? What I need is this:
    1. Ungroup everything in a spread
    2. A loop that goes through every text frame in the spread and, at the end of the text contained in each of those frames inserts a blank paragraph. (The frames contains text and inline graphics)
    This may seems strange but is what I need.
    Best regards and thank you in advance
    Maria

    I like scripts very much but scripting does not seems to like me! Can anyone help me and write a script for me? What I need is this:
    It's much easier for you to show us what you have and then we'll fix it for you or tell you what is wrong. Then you'll learn something to!
    1. Ungroup everything in a spread 
    This one's easy -- unless you're worried about groups inside groups?
    app.activeWindow.activeSpread.groups.everyItem().ungroup()
    If it's groups all-the-way-down, on the other hand, well, it might be more than one line...

  • 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...

Maybe you are looking for