Script help wanted

I search a script that will disable the alt+F4 so that the viewer can only see my website fullscreen!! In order to protect the sourcecode I want to disable the viewsource function. Can you svp mail me such a script !!!!! I work on a public computer so it is not likely I can revisit this forum soon, if you write anyway mail me svp
[email protected]

1. This is a Java forum, we don't do JavaScript (in general)
2. None of the things you say can be done properly - there will always be ways to go round.
3. Thanks to the email notification system you can / could receive a short email with a link to this thread the minute somebody replies.

Similar Messages

  • Firefox not responding, freezes, sometimes responds after a few minutes, other times a pop-up appears asking if I want to stop script - help please

    firefox not responding, freezes, sometimes responds after a few minutes, other times a pop-up appears asking if I want to stop script - help please

    Start Firefox in [[Safe Mode]] to check if one of the add-ons is causing the problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    * Don't make any changes on the Safe mode start window.
    See:
    * [[Troubleshooting extensions and themes]]
    * [[Troubleshooting plugins]]
    If it does work in Safe-mode then disable all extensions and then try to find which is causing it by enabling one at a time until the problem reappears.
    * Use "Disable all add-ons" on the [[Safe mode]] start window to disable all extensions.
    * Close and restart Firefox after each change via "File > Exit" (Mac: "Firefox > Quit"; Linux: "File > Quit")

  • UCCX Script help

    What the script trys to accomplish,  & I cant seem to figure out.
    Someone calls in if their ANI is recognized (check against a database of numbers for authentication) - send them to another piece of the script.
    Seems easy but I do not know how to:
    1 automatically confirm the digits I.E. compare string from database to ANI
    2. Once confirmed automatically send them to the second piece of the script, using location info from database.
    Ex. So if I call into the script it knows my cell phone and recognized me and knows Im calling in from the new jersey (because thats in the database) and sends me to the new jersey label in the script.
    Database has phonenumbers and location info in it. Can this be done? any insight would help. Im running ccm 7 and UCCX 7.
    Julius

    Sounds pretty straight forward.
    Create labels for each point in the script you want each location to jump to.
    Add a Get Call Contact Info step and assign the calling number to a variable.
    Do a DB Get into the database to search for the ANI, assign the location to another variable if it's matched
    Do a Switch on the location and for each location in the switch, put a GoTo the appropriate label.
    Chuck the script in reactive mode and put a call through it to make sure your database has numbers formatted correctly matching what is getting presented as the ANI from the gateways.
    Hope that helps.
    Cheers,
    Nathan

  • I replaced my printer. Now Itunes help wants to print to my old printer. How do i change the printer in Itunes?

    I replaced my printer with an newer printer. Now itunes Help wants to print to my old printer.How do I change Itunes to print to my new printer?

    Sorry, It was not Itunes. My laptop had reverted back to my old printer.

  • Java Script (Help Required)

    We are using the following code in HTML Header of the page
    //replaces the enter key with the tab key
    document.onkeydown = function ()
    if (event.keyCode == 13)
    event.keyCode=9;
    </script>
    We want to execute this code when current Item is not :P3_REMARKS (which is text area)
    Regards
    Jazib

    example of a name of an item
    About Referencing Items Using JavaScript
    When you reference an item, the best approach is to reference by ID. If you view the HTML source of an Oracle HTML DB page in a Web browser, you would notice that all items have an ID attribute. This ID corresponds to the name of the item, not the item label. For example, if you create an item with the name P1_FIRST_NAME and a label of First Name, the ID will be P1_FIRST_NAME.
    Knowing the item ID enables you to use the JavaScript function getElementById to get and set item attributes and values. The following example demonstrates how to reference an item by ID and display its value in an alert box.
    <script language="JavaScript1.1" type="text/javascript">
    function firstName(){   
    alert('First Name is ' + document.getElementById('P1_FIRST_NAME').value );
    // or a more generic version would be
    function displayValue(id){   
    alert('The Value is ' + document.getElementById(id).value );
    </script>
    // Then add the following to the "Form Element Attributes" Attribute of the item:
    onChange="javascript:displayValue('P1_FIRST_NAME');"
    Kind regards,
    Iloon

  • Gallery script help, please

    Gallery script help, please
    Hello,
    I'm new to actionscript in general, I do know a little...
    I foung a gallery script, modified many things, the images
    open fine, everything is working, but here's the thing:
    the gallery is in 3 sections, red, blue and yellow.
    I would like to know how, what, and where to put a script so
    that if a "the small red image #1" is clicked, I can load any sort
    of a movie on top of the "the BIG red image #1" or #2 or 3 and so
    on...same goes for the blue and yellow...
    If I figured things correctly on my own...the small thumbnail
    images of the gallery are not buttons, that's why I can't attach a
    movie (let's say) to them...but it is all written in script, using
    the horizontal and vertical position of the mouse to open the large
    images of the gallery...
    So, I don't know how to figure things out, to attach a
    specific movie to a specific thumbnail...
    p.s.: I think the script that controls the gallery is in
    symbol 120
    I really would appreciate the help
    Merry Christmas in advance to everyone
    Sandra
    here are all the files...
    http://www.gentro.ca/sandra_test.zip

    There's a great tutorial on kirupa...
    click
    here for link

  • So a user exit script is just a function library? What if I have two scripts I want to use?

    Sorry if this is a dumb question, but from what I gather from various examples I've seen online the User Exit piece of MDT lets you specify a script that can contain a library of *multiple* functions right? So what if I have two User Exit Scripts I want
    to use in MDT? Do I just copy the functions I want into a single user exit script and only reference that or is there a way to reference two user exit scripts in customsettings.ini?

    Those two routers don't have USB ports nor similar. Unless you have a network printer you cannot connect the printer to the network. You have to connect the printer to a computer and use printer sharing to make it accessible from the LAN.
    If the printer only has a wired network interface you must run a wire to the LAN. You cannot use the wireless routers to create a wireless bridge. You must run a wire between them to make any use of those two routers. But of course, if you run a wire anyway you could simply connect the network printer directly to the WRT.

  • Hi gurus in scripts i want to display more then one main window on the page

    hi gurus in scripts i want to display more then one main window on the page how it is to follow any body explain to me plz.

    Hi all,
        I am printing check printing from F110 with Z-form and it has been assigne to FBZP also..
        My client need to print the check information twise that means main window data two times.
        like this: 
           First main window.  :      invice#       amt            amt
                                               9002          4000          4000
                                               9005          5000          4000
    Al so they want like to print same in down part of the main window.
           First main window.  :      invice#       amt            amt
                                               9002          4000          4000
                                               9005          5000          4000
    For this i  have created instance main window of main window like MAIN    01,  but it is not displaying the data in instnce window data
    in the instance main window. 
    Question: Could you please let me know abt the same or good solution. How to cal main window instance , i tried with  
    /:   NEW-WINDOW      in instance main window part but it also appering in main windoe also.
    could you please let me know how to call instance main window or any other solution to get teh data like my example above.
    thx

  • With the help of script i want to identify each and every thing in a indesign file

          i want to identify the each and every thing in a .indd file with help of script.and also i have to find totally how many farmes or things present in that file
    kindly guys help me out.
    and also suggest me some ideas.
    thanks in advance
    regards,
    siv 

    thanks ya...
    Actually my recuirment is there will be so many number of frame or text frame will present there in a indd file
    >with the help script im giving number to the script label . it follows the order of Stack
    (the frame designed latest will get the latest script label)
    >in a particular order the frame has to get numbered in script label
    i.e
    either from right to left or left to right.
    hope u got my point
    kindly help me out
    regards siv

  • Script for color space conversion RGB to CMYK - URGENT Help Wanted

    Excuse my ignorance with the basic nature of this question, I don't use InDesign, but I do have a pressing problem regarding it.
    My book publisher has just emailed to say that my photography book has been set for the printers in InDesign and the photographs have AdobeRGB color space (which was what I was aksed to send.) The printer needs the images to be in CMYK. The publisher said that he was "pretty sure Adobe Acrobat converts the InDesign files to CMYK" and that he has sent the printer RGB images in the past and they "came out OK". He said that if this will not work, he needs to convert all of the images separately to CMYK.
    Can you help with the following:
    1. Is he right about the above - can Adobe Acrobat convert the files?
    2. Can anyone offer me a script that will convert all of the images in InDesign to CMYK? or will he need to change them individually?
    Thanks for any suggestions with this urgent request.
    Stephen

    1. Acrobat can convert.
    2. No need for a script, if the printer needs CMYK, you can export a CMYK pdf.
    3. To get the highest quality conversions, you might want to do it in Photoshop.
    4. If the images are color managed and the printer has a modern work-flow a color managed RGB PDFX-4 pdf is probably the best way to go...
    Harbs

  • Help wanted for modifying script

    This is a new request following an answer from an earlier thread.
    I have got written permition from Steve Wareham to use his script, and get it modifyed to suit my needs. I offered him to do the job for me, but he asked me to pass it on. I don't know anything about scripting, so I would like someone to do the job for me.
    The script is this one from the earlier discussion no. 5799917, kindly modified and posted by Vandy88: http://forums.adobe.com/message/5799917#5799917
    As mentioned in the end, I would like to recieve help on having the script modified to have another option in the dialogbox "Perform operation on" where I can chose a page range for the script to be affecting?
    ie: From page ____ to page ____ .
    I want to use this on long documents with step-by-step instructions, where I sometimes need to remove a step in the middle, and therefore need the numbers changed for the rest of the document. The textboxes with numbers are using Paragraph Styles and are not linked. Due to other reasons it is not a solution to just link the textflow.
    I will pay a reasonable fee for help on this. Please include an estimate on the cost for re-scripting this.
    It needs to work on InDesign CS6 (IE version) and preferable on CC too.

    This is a new request following an answer from an earlier thread.
    I have got written permition from Steve Wareham to use his script, and get it modifyed to suit my needs. I offered him to do the job for me, but he asked me to pass it on. I don't know anything about scripting, so I would like someone to do the job for me.
    The script is this one from the earlier discussion no. 5799917, kindly modified and posted by Vandy88: http://forums.adobe.com/message/5799917#5799917
    As mentioned in the end, I would like to recieve help on having the script modified to have another option in the dialogbox "Perform operation on" where I can chose a page range for the script to be affecting?
    ie: From page ____ to page ____ .
    I want to use this on long documents with step-by-step instructions, where I sometimes need to remove a step in the middle, and therefore need the numbers changed for the rest of the document. The textboxes with numbers are using Paragraph Styles and are not linked. Due to other reasons it is not a solution to just link the textflow.
    I will pay a reasonable fee for help on this. Please include an estimate on the cost for re-scripting this.
    It needs to work on InDesign CS6 (IE version) and preferable on CC too.

  • Want to write my personal Arch_Install Script, help please..

    Hi, guys, I want to write a script to make my arch-installation automatic. The following is my personal procedures I follow to install my Arch.
    I am wondering is there any way I can make it automatic instead of input every command manually, for example starting from "Adduser" after reboot after the base installation, can I make the rest run automatically by a script?
    Will it work if I simply write all commands one by one in each line into a text file, and exec it after chmod +x ?
    Or any suggestions?
    Thanks. :)
    ARCHLICH INSTALLATION
          <=============================boot==============================>
    1. Install Base system from FTP/HTTP-USB
    2. Configure system:
       1)rc.conf (HOSTNAME="home")
       2)etc/hosts (".. localhost home")
       3)locale.gen
       4)Root password
    3. Grub Install, change waiting time from 5 to 0.
          >=============================Reboot==============================<
    1. Adduser (tty,disk,video,audio,optical,storage,wheel) seperat by a single ","
    2. Setup sudo
       1)pacman -S sudo
       2)nano /etc/sudoers (uncomment "%wheel  ALL=(ALL) ALL")
    3. Xorg, driver, xorg.conf
       1)pacman -Sy xorg-server xorg-xinit xf86-input-mouse xf86-input-keyboard
       2)pacman -Sy nvidia
       3)mkdir "/mnt/backup" and mount /dev/sdb1
       4)copy xorg.conf from /mnt/backup/linux-backup/arch to /etc/X11
    4. Fonts & Scim (scim is configured later)
       1)pacman -Sy ttf-dejavu
       2)pacman -Sy ttf-ms-fonts artwiz-fonts
       3)pamcna -Sy terminus-font
       4)pacman -Sy ttf-arphic-uming ttf-arphic-ukai ttf-fireflysung
       5)pacman -Sy scim scim-pinyin
    5. Install OpenBox and Thunar
       1)openbox, lxappearance, gtk2-themes-collection, openbox-themes, nitrogen
       2)gamin, thunar, unrar, unzip, xarchiver, thunar-archive-plugin
       3)mousepad, rxvt-unicode, gqview
       4)MODULES=(!soundcore)
       5)DAEMONS=(.. dbus hal)
    6. nano /etc/inittab
       1)id:5:initdefault:  (unmoment the one with 3)
       2)comment out agetty3-6
       3)add the following line to the bottom and uncomment others:
        x:5:once:/bin/su kevin -l -c "/bin/bash --login -c startx >/dev/null 2>&1"
    7. log into kevin
       1)mkdir .config and cp openbox into it from backup
       2)mkdir .themes and cp DarkFiber into it from backup
       3)nano .xinitrc add "exec openbox-session"
       4)cp .Xdefaults to  ~/ from backup
          >=============================Reboot==============================<
    0. Mount sdb1 as root and cp .bashrc_root to root's home as .bashrc
    1. Exit to kevin and cp .bashrc to kevin's home.
    2. Install cpu-frequency
       1)pacman -S cpufrequtils
       2)nano /etc/conf.d/cpufreq:
                           min_freq="2GHz"
                           max_freq="2.7GHz"
    3. lm_sensors
       1)pacman -Sy lm_sensors
       2)sensors-detect
    4. NumbLock
       1)pacman -S numlockx
       2)add it to ~/.xinitrc:
    numlockx &
    nitrogen --restore &
    #conky &
    exec openbox-session
    5. Install OSS
       1)pacman -S oss
    6. Install Openntpd to adjust your computer time.
       1)pacman -S openntpd
    7. Diable IPv6 Module, mousepad /etc/modprobe.conf, and add:
    # disable autoload of ipv6
    alias net-pf-10 off
    8. Copy PolicyKit.conf from backup to /etc/PolicyKit/, for USB to auto-mount.
    9. Edit MODULES and DAEMONS:
    MODULES=(!soundcore powernow-k8 cpufreq_ondemand)
    DAEMONS=(syslog-ng network netfs crond dbus hal cpufreq sensors oss)    [Optional: preload]
    10. Add /etc/sudoers.(!Remember to have a new line in the end!)
    %users   ALL=NOPASSWD:/sbin/shutdown
    11. Edit /etc/fstab,(copy the 2 lines from /arch/fstab in backup)
      1)use nitrogen to change wallpaper
          >=============================Reboot==============================<
                                 APPLICATION INSTALLATION
          >================================================================<
    0. obmenu, obconf, librsvg
    1. firefox, flashplugin
    2. mplayer, mplayer-plugin, codecs
    4. cd /backup/linux: pacman -U mpg123-oss-TAB [ossxmix to diable vmix]
    5. openoffice-base, jre
    6. emacs (copy .emacs .virc to ~/ to prevent *~ file)(M-x custmize-variable RET
       latex-run-command RET, then change latex into pdflatex)
    7. texlive-most
    8. conky [edit .xinitrc to auto-start conky]
       (cp .conkrc and .weather and chmod +x .weather)
    9. tuxguitar
    10. openssh, sshfs
       1)mkdir .ssh, then as root cp private key to .ssh
       2)mkdir /mnt/yzhao and chown kevin:users /yzhao
                          nano /etc/pacman.conf
    [kdemod-legacy]
    Server = http://mirror.rit.edu/kdemod/legacy/i686
           <=====================OR=======================>
    [kdemod-legacy]
    Server = http://mirror.rit.edu/kdemod/legacy/x86_64
    11. kdemod3-kdegraphics-kdvi, kdemod3-kdegraphics-kpdf
    12. kile, k3b
    13. Add ":/opt/kde/bin" to /etc/profile, to use kde applications.
    14. Configure Scim to be usable, add to /etc/profile:
    export XMODIFIERS=@im=SCIM
    export GTK_IM_MODULE="scim"
    export QT_IM_MODULE="scim"
    scim -d
    15. deluge, pidgin [diable system tray, ossplay %s]
          <=============================End==============================>
    Last edited by yingwuzhao (2009-04-04 21:12:20)

    Well if you want to do all that, you obviously need to learn about bash scripting.
    You can also have a look at the automatic procedure from aif, which is made exactly for automatic installations.  See http://bbs.archlinux.org/viewtopic.php?id=58110

  • Help wants Java script enabled

    I'm trying to access FCP Help; and it's asking for Java script to be enabled in order to work.
    Does anyone know how to do this? I don't see anything in the System Preferences.
    Thanks!

    See here:
    http://support.apple.com/kb/TS2860

  • Saveas Scripting help request

    I am trying to piece together a maro that will initially resize an image and save it with a different suffix at different size increments. I found within the cs5 scripts folder the macro 'Fit Image.jsx' that would allow me to resize correctly but am lost on how to add in the subsequent save steps and additional resize and saves. I would like to have it save the image with 5 different file sizes and suffixes (400x400 '-2' suffix, 250x250 '-2T', 150x150 '-1', 100x100 '-0', and 50x50 '-2S'). I found some information on the saveas http://forums.adobe.com/message/2652204 but have no experience with javascript. I have some understanding of VBA and believe a loop could be used but haven't the slightest idea how to set this up. Is there anyone out there that could help walk me through this and lend me a hand?
    ---Below contains the 'Fit Image.jsx' file that I found---
    // c2008 Adobe Systems, Inc. All rights reserved.
    // Written by Ed Rose
    // based on the ADM Fit Image by Charles A. McBrian from 1997
    // edited by Mike Hale added option to avoid resize on images already smaller than target size
    @@@BUILDINFO@@@ Fit Image.jsx 1.0.0.21
    /* Special properties for a JavaScript to enable it to behave like an automation plug-in, the variable name must be exactly
       as the following example and the variables must be defined in the top 1000 characters of the file
    // BEGIN__HARVEST_EXCEPTION_ZSTRING
    <javascriptresource>
    <name>$$$/JavaScripts/FitImage/Name=Fit Image...</name>
    <menu>automate</menu>
    <enableinfo>true</enableinfo>
    <eventid>3caa3434-cb67-11d1-bc43-0060b0a13dc4</eventid>
    <terminology><![CDATA[<< /Version 1
                             /Events <<
                              /3caa3434-cb67-11d1-bc43-0060b0a13dc4 [($$$/AdobePlugin/FitImage/Name=Fit Image) /imageReference <<
                               /width [($$$/AdobePlugin/FitImage/Width=width) /pixelsUnit]
                               /height [($$$/AdobePlugin/FitImage/Height=height) /pixelsUnit]
                               /limit [($$$/AdobePlugin/FitImage/limit=Don't Enlarge) /boolean]
                              >>]
                             >>
                          >> ]]></terminology>
    </javascriptresource>
    // END__HARVEST_EXCEPTION_ZSTRING
    // enable double clicking from the Macintosh Finder or the Windows Explorer
    #target photoshop
    // debug level: 0-2 (0:disable, 1:break on error, 2:break at beginning)
    // $.level = 2;
    // debugger; // launch debugger on next line
    // on localized builds we pull the $$$/Strings from a .dat file, see documentation for more details
    $.localize = true;
    var isCancelled = true; // assume cancelled until actual resize occurs
    // the main routine
    // the FitImage object does most of the work
    try {
        // create our default params
        var sizeInfo = new SizeInfo();
        GlobalVariables();
        CheckVersion();
        var gIP = new FitImage();
        if ( DialogModes.ALL == app.playbackDisplayDialogs ) {
            gIP.CreateDialog();
            gIP.RunDialog();
        else {
            gIP.InitVariables();
            ResizeTheImage(sizeInfo.width.value, sizeInfo.height.value);
        if (!isCancelled) {
            SaveOffParameters(sizeInfo);
    // Lot's of things can go wrong
    // Give a generic alert and see if they want the details
    catch( e ) {
        if ( DialogModes.NO != app.playbackDisplayDialogs ) {
            alert( e + " : " + e.line );
    // restore the dialog modes
    app.displayDialogs = gSaveDialogMode;
    isCancelled ? 'cancel' : undefined;
    function ResizeTheImage(width, height) {
        var oldPref = app.preferences.rulerUnits;
        var docWidth;
        var docHeight;
        var docRatio;
        var newWidth;
        var newHeight;
        var resolution = app.activeDocument.resolution;
        var limit = sizeInfo.limit;
        app.preferences.rulerUnits = Units.PIXELS; // save old preferences
        // original width, height
        docWidth = (1.0 * app.activeDocument.width * resolution) / 72.0; // decimal inches assuming 72 dpi (used in docRatio)
        docHeight = (1.0 * app.activeDocument.height * resolution) / 72.0; // ditto
        if (docWidth < 1.0 || docHeight < 1.0)
            return true; // error
        if (width < 1 || height < 1)
            return true; // error
        if ( limit && ( docWidth <= width && docHeight <= height ) ){
            app.preferences.rulerUnits = oldPref; // restore old prefs
            isCancelled = false; // if get here, definitely executed
            return false; // no error
        docRatio = docWidth / docHeight; // decimal ratio of original width/height
        newWidth = width;
        newHeight = ((1.0 * width) / docRatio); // decimal calc
        if (newHeight > height) {
            newWidth = docRatio * height; // decimal calc
            newHeight = height;
        // resize the image using a good conversion method while keeping the pixel resolution
        // and the aspect ratio the same
        app.activeDocument.resizeImage(newWidth, newHeight, resolution, ResampleMethod.BICUBIC);
        app.preferences.rulerUnits = oldPref; // restore old prefs
        isCancelled = false; // if get here, definitely executed
        return false; // no error
    // created in
    function SaveOffParameters(sizeInfo) {
        // save off our last run parameters
        var d = objectToDescriptor(sizeInfo, strMessage);
        app.putCustomOptions("3caa3434-cb67-11d1-bc43-0060b0a13dc4", d);
        app.playbackDisplayDialogs = DialogModes.ALL;
        // save off another copy so Photoshop can track them corectly
        var dd = objectToDescriptor(sizeInfo, strMessage);
        app.playbackParameters = dd;
    function GlobalVariables() {
        // a version for possible expansion issues
        gVersion = 1.1;
        gMaxResize = 300000;
        // remember the dialog modes
        gSaveDialogMode = app.displayDialogs;
        app.displayDialogs = DialogModes.NO;
        gInAlert = false;
        // all the strings that need to be localized
        strTitle = localize( "$$$/JavaScript/FitImage/Title=Fit Image" );
        strConstrainWithin = localize( "$$$/JavaScript/FitImage/ConstrainWithin=Constrain Within" );
        strTextWidth = localize("$$$/JavaScripts/FitImage/Width=&Width:");
        strTextHeight = localize("$$$/JavaScripts/FitImage/Height=&Height:");
        strTextPixels = localize("$$$/JavaScripts/FitImage/Pixels=pixels");
        strButtonOK = localize("$$$/JavaScripts/FitImage/OK=OK");
        strButtonCancel = localize("$$$/JavaScripts/FitImage/Cancel=Cancel");
        strTextSorry = localize("$$$/JavaScripts/FitImage/Sorry=Sorry, Dialog failed");
        strTextInvalidType = localize("$$$/JavaScripts/FitImage/InvalidType=Invalid numeric value");
        strTextInvalidNum = localize("$$$/JavaScripts/FitImage/InvalidNum=A number between 1 and 300000 is required. Closest value inserted.");
        strTextNeedFile = localize("$$$/JavaScripts/FitImage/NeedFile=You must have a file selected before using Fit Image");
        strMessage = localize("$$$/JavaScripts/FitImage/Message=Fit Image action settings");
        strMustUse = localize( "$$$/JavaScripts/ImageProcessor/MustUse=You must use Photoshop CS 2 or later to run this script!" );
        strLimitResize = localize("$$$/JavaScripts/FitImage/Limit=Don^}t Enlarge");
    // the main class
    function FitImage() {
        this.CreateDialog = function() {
            // I will keep most of the important dialog items at the same level
            // and use auto layout
            // use overriding group so OK/Cancel buttons placed to right of panel
            var res =
                "dialog { \
                    pAndB: Group { orientation: 'row', \
                        info: Panel { orientation: 'column', borderStyle: 'sunken', \
                            text: '" + strConstrainWithin +"', \
                            w: Group { orientation: 'row', alignment: 'right',\
                                s: StaticText { text:'" + strTextWidth +"' }, \
                                e: EditText { preferredSize: [70, 20] }, \
                                p: StaticText { text:'" + strTextPixels + "'} \
                            h: Group { orientation: 'row', alignment: 'right', \
                                s: StaticText { text:'" + strTextHeight + "' }, \
                                e: EditText { preferredSize: [70, 20] }, \
                                p: StaticText { text:'" + strTextPixels + "'} \
                            l: Group { orientation: 'row', alignment: 'left', \
                                    c:Checkbox { text: '" + strLimitResize + "', value: false }, \
                        buttons: Group { orientation: 'column', alignment: 'top',  \
                            okBtn: Button { text:'" + strButtonOK +"', properties:{name:'ok'} }, \
                            cancelBtn: Button { text:'" + strButtonCancel + "', properties:{name:'cancel'} } \
            // the following, when placed after e: in w and h doesn't show up
            // this seems to be OK since px is put inside the dialog box
            //p: StaticText { text:'" + strTextPixels + "'}
            // create the main dialog window, this holds all our data
            this.dlgMain = new Window(res,strTitle);
            // create a shortcut for easier typing
            var d = this.dlgMain;
            // match our dialog background color to the host application
            d.graphics.backgroundColor = d.graphics.newBrush (d.graphics.BrushType.THEME_COLOR, "appDialogBackground");
            d.defaultElement = d.pAndB.buttons.okBtn;
            d.cancelElement = d.pAndB.buttons.cancelBtn;
        } // end of CreateDialog
        // initialize variables of dialog
        this.InitVariables = function() {
            var oldPref = app.preferences.rulerUnits;
            app.preferences.rulerUnits = Units.PIXELS;
            // look for last used params via Photoshop registry, getCustomOptions will throw if none exist
            try {
                var desc = app.getCustomOptions("3caa3434-cb67-11d1-bc43-0060b0a13dc4");
                descriptorToObject(sizeInfo, desc, strMessage);
            catch(e) {
                // it's ok if we don't have any options, continue with defaults
            // see if I am getting descriptor parameters
            var fromAction = !!app.playbackParameters.count;
            if( fromAction ){
                // reset sizeInfo to defaults
                SizeInfo = new SizeInfo();
                // set the playback options to sizeInfo
                descriptorToObject(sizeInfo, app.playbackParameters, strMessage);
            // make sure got parameters before this
            if (app.documents.length <= 0) // count of documents viewed
                if ( DialogModes.NO != app.playbackDisplayDialogs ) {
                    alert(strTextNeedFile); // only put up dialog if permitted
                app.preferences.rulerUnits = oldPref;
                return false; // if no docs, always return
            var w = app.activeDocument.width;
            var h = app.activeDocument.height;
            var l = true;
            if (sizeInfo.width.value == 0) {
                sizeInfo.width = w;
            else {
                w = sizeInfo.width;
            if (sizeInfo.height.value == 0) {
                sizeInfo.height = h;
            else {
                h = sizeInfo.height;
            app.preferences.rulerUnits = oldPref;
            if ( DialogModes.ALL == app.playbackDisplayDialogs ) {
                var d = this.dlgMain;
                d.ip = this;
                d.pAndB.info.w.e.text = Number(w);
                d.pAndB.info.h.e.text = Number(h);
                d.pAndB.info.l.c.value = sizeInfo.limit;
            return true;
        // routine for running the dialog and it's interactions
        this.RunDialog = function () {
            var d = this.dlgMain;
            // in case hit cancel button, don't close
            d.pAndB.buttons.cancelBtn.onClick = function() {
                var dToCancel = FindDialog( this );
                dToCancel.close( false );
            // nothing for now
            d.onShow = function() {
            // do not allow anything except for numbers 0-9
            d.pAndB.info.w.e.addEventListener ('keydown', NumericEditKeyboardHandler);
            // do not allow anything except for numbers 0-9
            d.pAndB.info.h.e.addEventListener ('keydown', NumericEditKeyboardHandler);
            // hit OK, do resize
            d.pAndB.buttons.okBtn.onClick = function () {
                if (gInAlert == true) {
                    gInAlert = false;
                    return;
                var wText = d.pAndB.info.w.e.text;
                var hText = d.pAndB.info.h.e.text;
                var lValue = d.pAndB.info.l.c.value;
                var w = Number(wText);
                var h = Number(hText);
                sizeInfo.limit = Boolean(lValue);
                var inputErr = false;
                if ( isNaN( w ) || isNaN( h ) ) {
                    if ( DialogModes.NO != app.playbackDisplayDialogs ) {
                        alert( strTextInvalidType );
                    if (isNaN( w )) {
                        sizeInfo.width = new UnitValue( 1, "px" );
                        d.pAndB.info.w.e.text = 1;
                    } else {
                        sizeInfo.height = new UnitValue( 1, "px" );
                        d.pAndB.info.h.e.text = 1;
                        return false;
                else if (w < 1 || w > gMaxResize || h < 1 || h > gMaxResize) {
                    if ( DialogModes.NO != app.playbackDisplayDialogs ) {
                        gInAlert = true;
                        alert( strTextInvalidNum );
                if ( w < 1) {
                    inputErr = true;
                    sizeInfo.width = new UnitValue( 1, "px" );
                    d.pAndB.info.w.e.text = 1;
                if ( w > gMaxResize) {
                    inputErr = true;
                    sizeInfo.width = new UnitValue( gMaxResize, "px" );
                    d.pAndB.info.w.e.text = gMaxResize;
                if ( h < 1) {
                    inputErr = true;
                    sizeInfo.height = new UnitValue( 1, "px" );
                    d.pAndB.info.h.e.text = 1;
                if ( h > gMaxResize) {
                    inputErr = true;
                    sizeInfo.height = new UnitValue( gMaxResize, "px" );
                    d.pAndB.info.h.e.text = gMaxResize;
                if (inputErr == false)  {
                    sizeInfo.width = new UnitValue( w, "px" );
                    sizeInfo.height = new UnitValue( h, "px" );
                    if (ResizeTheImage(w, h)) { // the whole point
                        // error, input or output size too small
                    d.close(true);
                return;
            if (!this.InitVariables())
                return true; // handled it
            // give the hosting app the focus before showing the dialog
            app.bringToFront();
            this.dlgMain.center();
            return d.show();
    function CheckVersion() {
        var numberArray = version.split(".");
        if ( numberArray[0] < 9 ) {
            if ( DialogModes.NO != app.playbackDisplayDialogs ) {
                alert( strMustUse );
            throw( strMustUse );
    function FindDialog( inItem ) {
        var w = inItem;
        while ( 'dialog' != w.type ) {
            if ( undefined == w.parent ) {
                w = null;
                break;
            w = w.parent;
        return w;
    // Function: objectToDescriptor
    // Usage: create an ActionDescriptor from a JavaScript Object
    // Input: JavaScript Object (o)
    //        object unique string (s)
    //        Pre process converter (f)
    // Return: ActionDescriptor
    // NOTE: Only boolean, string, number and UnitValue are supported, use a pre processor
    //       to convert (f) other types to one of these forms.
    // REUSE: This routine is used in other scripts. Please update those if you
    //        modify. I am not using include or eval statements as I want these
    //        scripts self contained.
    function objectToDescriptor (o, s, f) {
        if (undefined != f) {
            o = f(o);
        var d = new ActionDescriptor;
        var l = o.reflect.properties.length;
        d.putString( app.charIDToTypeID( 'Msge' ), s );
        for (var i = 0; i < l; i++ ) {
            var k = o.reflect.properties[i].toString();
            if (k == "__proto__" || k == "__count__" || k == "__class__" || k == "reflect")
                continue;
            var v = o[ k ];
            k = app.stringIDToTypeID(k);
            switch ( typeof(v) ) {
                case "boolean":
                    d.putBoolean(k, v);
                    break;
                case "string":
                    d.putString(k, v);
                    break;
                case "number":
                    d.putDouble(k, v);
                    break;
                default:
                    if ( v instanceof UnitValue ) {
                        var uc = new Object;
                        uc["px"] = charIDToTypeID("#Pxl"); // pixelsUnit
                        uc["%"] = charIDToTypeID("#Prc"); // unitPercent
                        d.putUnitDouble(k, uc[v.type], v.value);
                    } else {
                        throw( new Error("Unsupported type in objectToDescriptor " + typeof(v) ) );
        return d;
    // Function: descriptorToObject
    // Usage: update a JavaScript Object from an ActionDescriptor
    // Input: JavaScript Object (o), current object to update (output)
    //        Photoshop ActionDescriptor (d), descriptor to pull new params for object from
    //        object unique string (s)
    //        JavaScript Function (f), post process converter utility to convert
    // Return: Nothing, update is applied to passed in JavaScript Object (o)
    // NOTE: Only boolean, string, number and UnitValue are supported, use a post processor
    //       to convert (f) other types to one of these forms.
    // REUSE: This routine is used in other scripts. Please update those if you
    //        modify. I am not using include or eval statements as I want these
    //        scripts self contained.
    function descriptorToObject (o, d, s, f) {
        var l = d.count;
        if (l) {
            var keyMessage = app.charIDToTypeID( 'Msge' );
            if ( d.hasKey(keyMessage) && ( s != d.getString(keyMessage) )) return;
        for (var i = 0; i < l; i++ ) {
            var k = d.getKey(i); // i + 1 ?
            var t = d.getType(k);
            strk = app.typeIDToStringID(k);
            switch (t) {
                case DescValueType.BOOLEANTYPE:
                    o[strk] = d.getBoolean(k);
                    break;
                case DescValueType.STRINGTYPE:
                    o[strk] = d.getString(k);
                    break;
                case DescValueType.DOUBLETYPE:
                    o[strk] = d.getDouble(k);
                    break;
                case DescValueType.UNITDOUBLE:
                    var uc = new Object;
                    uc[charIDToTypeID("#Rlt")] = "px"; // unitDistance
                    uc[charIDToTypeID("#Prc")] = "%"; // unitPercent
                    uc[charIDToTypeID("#Pxl")] = "px"; // unitPixels
                    var ut = d.getUnitDoubleType(k);
                    var uv = d.getUnitDoubleValue(k);
                    o[strk] = new UnitValue( uv, uc[ut] );
                    break;
                case DescValueType.INTEGERTYPE:
                case DescValueType.ALIASTYPE:
                case DescValueType.CLASSTYPE:
                case DescValueType.ENUMERATEDTYPE:
                case DescValueType.LISTTYPE:
                case DescValueType.OBJECTTYPE:
                case DescValueType.RAWTYPE:
                case DescValueType.REFERENCETYPE:
                default:
                    throw( new Error("Unsupported type in descriptorToObject " + t ) );
        if (undefined != f) {
            o = f(o);
    // Function: SizeInfo
    // Usage: object for holding the dialog parameters
    // Input: <none>
    // Return: object holding the size info
    function SizeInfo() {
        this.height = new UnitValue( 0, "px" );
        this.width = new UnitValue( 0, "px" );
        this.limit = false;
    // Function: NumericEditKeyboardHandler
    // Usage: Do not allow anything except for numbers 0-9
    // Input: ScriptUI keydown event
    // Return: <nothing> key is rejected and beep is sounded if invalid
    function NumericEditKeyboardHandler (event) {
        try {
            var keyIsOK = KeyIsNumeric (event) ||
                          KeyIsDelete (event) ||
                          KeyIsLRArrow (event) ||
                          KeyIsTabEnterEscape (event);
            if (! keyIsOK) {
                //    Bad input: tell ScriptUI not to accept the keydown event
                event.preventDefault();
                /*    Notify user of invalid input: make sure NOT
                       to put up an alert dialog or do anything which
                             requires user interaction, because that
                             interferes with preventing the 'default'
                             action for the keydown event */
                app.beep();
        catch (e) {
            ; // alert ("Ack! bug in NumericEditKeyboardHandler: " + e);
    //    key identifier functions
    function KeyHasModifier (event) {
        return event.shiftKey || event.ctrlKey || event.altKey || event.metaKey;
    function KeyIsNumeric (event) {
        return  (event.keyName >= '0') && (event.keyName <= '9') && ! KeyHasModifier (event);
    function KeyIsDelete (event) {
        //    Shift-delete is ok
        return ((event.keyName == 'Backspace') || (event.keyName == 'Delete')) && ! (event.ctrlKey);
    function KeyIsLRArrow (event) {
        return ((event.keyName == 'Left') || (event.keyName == 'Right')) && ! (event.altKey || event.metaKey);
    function KeyIsTabEnterEscape (event) {
        return event.keyName == 'Tab' || event.keyName == 'Enter' || event.keyName == 'Escape';
    // End Fit Image.jsx

    With Photoshop CS5 you can use Image Processor Pro and this should do what you require...
    http://blogs.adobe.com/jnack/2011/05/new-image-processor-pro-script-for-cs5.html

  • Scripting help needed... please

    Help,
    I know this is a fairly basic scripting question, but for some stupid reason I just can't seem to get it.
    I am creating a DVD that has 2 different menus.
    There are only one set of tracks, but 2 different menus. What I want is something that tells the track to return to menu 1 if it played from menu 1 or to go to menu 2 if it played from menu 2
    Help please.
    Thanks

    Hi
    I think this is what you are looking for: * Multiple Menus with GPRM based button jumps * (Thanks Hal!)
    Hope that helps !
      Alberto

Maybe you are looking for

  • Keep getting pop-up message re updating RSS feed for twitter

    Please advise why I get this pop-up message. After I get it and fill in the info, I get another pop-up message asking for the same info, which doesn't take. What's going on? My Safari version is 4.1 (4533.16) Enter your name and password to update th

  • Can I fix my macbook or should I get a new one?

    Here are the problems I've been having. My original account runs extremely slowly. After a little while on that account, my laoptop starts to make a noise that sounds like a ball dropping inside of the machine. I made another account because this one

  • Tech support said I was the only one having issues!

    Verizon, How can you possibly say no one has complained or had similar issues with this phone when I come to this site to discover that hundreds of people have posted complaints?  I have had major issues with my LG revolution since I have got it and

  • AIM 5.9 for mac

    ive read the popular webpage tutorial about ichating with pc using AIM. ive tried to use ichat at first but on the tutorial it says 5.9 is the version of AIM that u can also use to video chat but at AIM.com it is an .exe file anyway to convert or any

  • Errors on pay award update (RPITRF00 )

    Hi Experts, The RPITRF00 When running this Programm for a specific PAY Scale Area 01 and Pay Scale type 20. It is producing errors which relate to any employees who don't have an IT8 and as well as who do not have these PSA's 01 or PST's 20.It should