Help with a Command script

Hello,
Awhile back someone wrote the following script for me. The
idea was to make a comman that would allow me to reduce an image
down to 400 pixel width without loss of scale. I want to have a
similiar command that will reduce a large image down to 400 pilel
height without loss of scale. I fiddled with the command for width
but can't get it to work for height. Can I get some help rewriting
the following command to work for 400 pixel height? Thanks.
// User Variables
var width = 400;
// Command
var dom = fw.getDocumentDOM();
var scale = width/dom.width;
var height = dom.height * scale;
dom.setDocumentImageSize({left:dom.left, top:dom.top,
right:dom.left+width, bottom:dom.top+height},
{pixelsPerUnit:dom.resolution, units:dom.resolutionUnits});

Tom Hersh wrote:
> I did try it that way. But I could not get it to work.
The word "scale" is critical, but I switching did not help.
Just switch the variables word for word. Height for width and
width for
height.
// User Variables
var width = 400;
// Command
var dom = fw.getDocumentDOM();
var scale = width/dom.width;
var height = dom.height * scale;
dom.setDocumentImageSize({left:dom.left, top:dom.top,
right:dom.left+width,
bottom:dom.top+height}, {pixelsPerUnit:dom.resolution,
units:dom.resolutionUnits});
// User Variables
var height = 400;
// Command
var dom = fw.getDocumentDOM();
var scale = height/dom.height;
var width = dom.width * scale;
dom.setDocumentImageSize({left:dom.left, top:dom.top,
right:dom.left+width,
bottom:dom.top+height}, {pixelsPerUnit:dom.resolution,
units:dom.resolutionUnits});
Once you see this script, it's not hard to see what it is
doing.
This is the Fireworks generated script scaling just the
height of an
image to 400 px from 640x480 px.
fw.getDocumentDOM()
.scaleSelection(0.83281248807907104, 0.83333333333333337,
"autoTrimImages transformAttributes");
This works on all 640x480 images. Throw in a 700x480 and it
won't.
I'm assuming, very few people in here (myself included),
would be able
to transform this into something that would account for
varying widths
as senocular did.
SKB

Similar Messages

  • Can anyone help with Double Command issues. This a specific keyboard question and they do not seem to know.

    Before I go into a lengthy explanation of the problem: Can anyone help with Double Command issues. This a specific keyboard question and they do not seem to know.
    Thanks much.
    Emile

    Choose Force Quit from the Apple menu and close Mail from there.
    (103661)

  • [solved]Need help with a bash script for MOC conky artwork.

    I need some help with a bash script for displaying artwork from MOC.
    Music folders have a file called 'front.jpg' in them, so I need to pull the current directory from MOCP and then display the 'front.jpg' file in conky.
    mocp -Q %file
    gives me the current file playing, but I need the directory (perhaps some way to use only everything after the last  '/'?)
    A point in the right direction would be appreciated.
    thanks, d
    Last edited by dgz (2013-08-29 21:24:28)

    Xyne wrote:
    You should also quote the variables and output in double quotes to make the code robust, e.g.
    filename="$(mocp -Q %file)"
    dirname="${filename%/*}"
    cp "$dirname"/front.jpg ~/backup/art.jpg
    Without the quotes, whitespace will break the code. Even if you don't expect whitespace in any of the paths, it's still good coding practice to include the quotes imo.
    thanks for the tip.
    here it is, anyhow:
    #!/bin/bash
    filename=$(mocp -Q %file)
    dirname=${filename%/*}
    cp ${dirname}/front.jpg ~/backup/art.jpg
    then in conky:
    $alignr${execi 30 ~/bin/artc}${image ~/backup/art.jpg -s 100x100 -p -3,60}
    thanks for the help.
    Last edited by dgz (2013-08-29 21:26:32)

  • Help with Expect command to change config on hundreds of ASA's.

    Hi All,
    I'm looking for some help with the Expect command to automate some tasks, I'm certainly no programmer but I am struggling, here is an example of my script.
    #!/usr/bin/expect -f
    # This simple Expect script will add a new Syslog destination in
    # Cisco switches (IOS based)
    # We assume here that all switches uses the same credentials
    # for the administrative tasks
    # Define variables
    set password "site1"
    set enablepassword "site1"
    # Define all the switches to be reconfigured (separated by spaces)
    set switches "site1 site2 site3"
    # Main loop
    foreach switch $switches {
            puts "Processing switch: $switch";
            # Open the telnet session:
            spawn telnet $switch
            # Perform authentication
            expect "Password:"
            send "$password\r"
            expect ">"
            # Switch to enable mode
            send "en\r"
            expect "Password:"
            send "$enablepassword\r"
            expect "#"
            # Enable configuration mode (terminal)
            send "conf t\r"
            expect "#"
            # Modify VLAN1
            send "interface vlan1\r"
            expect "#"
         # Change VLAN1 Description to Uppercase
            send "description INSIDE\r"
            expect "#"
            send "exit\r"
            expect "#"
            # Save config to NVRAM
            send "wr\r"
            expect "#"
            #Logging out
            send "exit\r"
            expect eof
    In the example this works fine for SITE1 passing the credentials SITE1 as the default password and SITE1 as the enable password.  I need to do usernames and passwords that are different for each site.  I have to make some changes across hundreds of ASA's to terminating tunnels to a new location.  Can anyone help out in how to do this, I know I am close I just need it to read, siteA, username, both passwords from a text file, etc
    Greg

    Hello,
    try to modify this example to your needs ->
    http://www.bitpapers.com/2012/04/cisco-changing-configurations-of-many.html
    Best Regards
    Please rate all helpful posts and close solved questions

  • Help with Custom calculation script in Acrobat 8

    Hi all, I am using acrobat 8 on OS 10.5
    I am trying to add certain fields (numbers) and then subtract another field value to give an end result.
    I don't know anything about Javascript, would anyone be able to help with any info on how I achieve this result? I can only see Add, x and average etc... nothing there for subtraction
    Thanks for any help in advance
    Swen

    This should get you started:
    >if (event) {
    // get values from two text fields
    var a = Number(this.getField('Text1').value);
    var b = Number(this.getField('Text2').value);
    // subtract the values and show it
    this.event.target.value = a - b;
    Place this in a 3d text field, as a Custom Calculation Script.

  • Help with first Adobe Script for AE?

    Hey,
    I'm trying to create a script that will allow me to set a certain number of layer markers at an even interval to mark out a song. Could someone help me troubleshoot this script? I've been working on it for ages now, and I'm about to snap. I've basically gone from HTML and CSS, to javascript and Adobe scripting in the past few hours, and I cannot figure this out for the life of me.
    I want to create a dialog with two fields, the number of markers to place, and the tempo of the song. Tempo is pretty simple, its just the number of beats per minute. The script is meant to start at a marker that I have already placed, and set a new marker at incrementing times. Its mainly to help me see what I'm trying to animate too, even if the beat is a little hard to pick up every once in a while.
    Also, is there a better way to do this? This script will help me in the long run because I will need to do this pretty often, but I'm wondering if there was something that I could not find online that would have saved me these hours of brain-jumbling?
    Thank you very much for any help you can offer.
        // Neo_Add_MultiMarkers.jsx
        //jasondrey13
        //2009-10-26
        //Adds multiple markers to the selected layer.
        // This script prompts for a certain number of layer markers to add to the selected audio layer,
        //and an optional "frames between" to set the number of frames that should be skipped before placing the next marker
        // It presents a UI with two text entry areas: a Markers box for the
        // number of markers to add and a Frames Between box for the number of frames to space between added markers.
        // When the user clicks the Add Markers button,
        // A button labeled "?" provides a brief explanation.
        function Neo_Add_MultiMarkers(thisObj)
            // set vars
            var scriptName = "Neoarx: Add Multiple Markers";
            var numberOfMarkers = "0";
            var tempo = "0";
            // This function is called when the Find All button is clicked.
            // It changes which layers are selected by deselecting layers that are not text layers
            // or do not contain the Find Text string. Only text layers containing the Find Text string
            // will remain selected.
            function onAddMarkers()
                // Start an undo group.  By using this with an endUndoGroup(), you
                // allow users to undo the whole script with one undo operation.
                app.beginUndoGroup("Add Multiple Markers");
                // Get the active composition.
                var activeItem = app.project.activeItem;
                if (activeItem != null && (activeItem instanceof CompItem)){
                    // Check each selected layer in the active composition.
                    var activeComp = activeItem;
                    var layers = activeComp.selectedLayers;
                    var markers = layers.property("marker");
                    //parse ints
                    numberOfMarkers = parseInt (numberOfMarkers);
                    tempo = parseInt (tempo);
                    // Show a message and return if there is no value specified in the Markers box.
                    if (numberOfMarkers < 1 || tempo < 1) {
                    alert("Each box can take only positive values over 1. The selection was not changed.", scriptName);
                    return;
                    if (markers.numKeys < 1)
                    alert('Please set a marker where you would like me to begin.');
                    return;
                    var beginTime = markers.keyTime( 1 );
                    var count = 1;
                    var currentTime = beginTime;
                    var addPer = tempo/60;
                    while(numberOfMarkers < count)
                    markers.setValueAtTime(currentTime, MarkerValue(count));
                    currentTime = currentTime + addPer;
                    if (count==numberOfMarkers) {
                        alert('finished!');
                        return;
                    else{
                        count++;
                app.endUndoGroup();
        // Called when the Markers Text string is edited
            function onMarkersStringChanged()
                numberOfMarkers = this.text;
            // Called when the Frames Text string is edited
            function onFramesStringChanged()
                tempo = this.text;
            // Called when the "?" button is clicked
            function onShowHelp()
                alert(scriptName + ":\n" +
                "This script displays a palette with controls for adding a given number of markers starting at a pre-placed marker, each separated by an amount of time determined from the inputted Beats Per Minute (Tempo).\n" +
                "It is designed to mark out the even beat of a song for easier editing.\n" +
                "\n" +
                "Type the number of Markers you would like to add to the currently selected layer. Type the tempo of your song (beats per minute).\n" +           
                "\n" +
                "Note: This version of the script requires After Effects CS3 or later. It can be used as a dockable panel by placing the script in a ScriptUI Panels subfolder of the Scripts folder, and then choosing this script from the Window menu.\n", scriptName);
            // main:
            if (parseFloat(app.version) < 8)
                alert("This script requires After Effects CS3 or later.", scriptName);
                return;
            else
                // Create and show a floating palette
                var my_palette = (thisObj instanceof Panel) ? thisObj : new Window("palette", scriptName, undefined, {resizeable:true});
                if (my_palette != null)
                    var res =
                    "group { \
                        orientation:'column', alignment:['fill','fill'], alignChildren:['left','top'], spacing:5, margins:[0,0,0,0], \
                        markersRow: Group { \
                            alignment:['fill','top'], \
                            markersStr: StaticText { text:'Markers:', alignment:['left','center'] }, \
                            markersEditText: EditText { text:'0', characters:10, alignment:['fill','center'] }, \
                        FramesRow: Group { \
                            alignment:['fill','top'], \
                            FramesStr: StaticText { text:'Tempo:', alignment:['left','center'] }, \
                            FramesEditText: EditText { text:'140', characters:10, alignment:['fill','center'] }, \
                        cmds: Group { \
                            alignment:['fill','top'], \
                            addMarkersButton: Button { text:'Add Markers', alignment:['fill','center'] }, \
                            helpButton: Button { text:'?', alignment:['right','center'], preferredSize:[25,20] }, \
                    my_palette.margins = [10,10,10,10];
                    my_palette.grp = my_palette.add(res);
                    // Workaround to ensure the editext text color is black, even at darker UI brightness levels
                    var winGfx = my_palette.graphics;
                    var darkColorBrush = winGfx.newPen(winGfx.BrushType.SOLID_COLOR, [0,0,0], 1);
                    my_palette.grp.markersRow.markersEditText.graphics.foregroundColor = darkColorBrush;
                    my_palette.grp.FramesRow.FramesEditText.graphics.foregroundColor = darkColorBrush;
                    my_palette.grp.markersRow.markersStr.preferredSize.width = my_palette.grp.FramesRow.FramesStr.preferredSize.width;
                    my_palette.grp.markersRow.markersEditText.onChange = my_palette.grp.markersRow.markersEditText.onChanging = onMarkersStringChanged;
                    my_palette.grp.FramesRow.FramesEditText.onChange = my_palette.grp.FramesRow.FramesEditText.onChanging = onFramesStringChanged;
                    my_palette.grp.cmds.addMarkersButton.onClick    = onAddMarkers;
                    my_palette.grp.cmds.helpButton.onClick    = onShowHelp;
                    my_palette.layout.layout(true);
                    my_palette.layout.resize();
                    my_palette.onResizing = my_palette.onResize = function () {this.layout.resize();}
                    if (my_palette instanceof Window) {
                        my_palette.center();
                        my_palette.show();
                    } else {
                        my_palette.layout.layout(true);
                else {
                    alert("Could not open the user interface.", scriptName);
        Neo_Add_MultiMarkers(this);

    You should ask such questions over at AEnhancers. I had a quick look at your code but could not find anything obvious, so it may relate to where and when you execute certain functions and how they are nested, I just don't have the time to do a deeper study.
    Mylenium

  • Help with web form script. PHP, CGI, Perl???

    anyone willing to help with a web form script? I have a form built, but cant seem to figure out the scripting! Should I be using Perl, CGI, PHP... What do I need to enable? I am a complete novice when it comes to scripts. Looking for a little friendly help.

    Here is a simple bit of PHP to stick in the page your form posts to. You would need to edit the first three variables to your liking, and add the html you want to serve afterwards:
    <pre>
    <?php
    $emailFrom = '[email protected]';
    $emailTo = '[email protected]';
    $emailSubject = 'Subject';
    $date = date('l, \t\h\e dS \o\f F, Y \a\t g:i A');
    $browser = $HTTPSERVER_VARS['HTTP_USERAGENT'];
    $hostname = $HTTPSERVER_VARS['REMOTEADDR'];
    $message = "$date\n\nAddress: $hostname\nBrowser: $browser\n\n";
    foreach ($_POST as $key => $value) {
    $message .= $key . ": " . $value . "\n";
    $mailResult = mail($emailTo,$emailSubject,$message,"From: $emailFrom");
    ?>
    </pre>
    This script will grab the server's date and the submitter's address and browser type. It will then list the name and value of each form field you have put on your form.
    Also, this script expects your form method="post".
    Lastly, you can offer alternate text later on in your html page based on the success of the above script with a snippet like this:
    <pre><?php
    if ($mailResult) {
    echo "Your comments have been received thank you.";
    } else {
    echo "There was an error. Please try again or contact us using an alternate method.";
    ?></pre>

  • Help with a startup script for monitorix

    How can I deal with a perl script that doesn't acknowledge a query for pidof?
    $ ps aux | grep monitorix
    root 1089 0.0 1.2 16280 6556 ? Ss 09:54 0:00 /usr/bin/monitorix -c /etc/monitorix.conf
    So it's running... but I can't find it with pidof:
    $ pidof /usr/bin/monitorix
    Here is the /etc/rc.d/monitorix I've been using but that doesn't stop the program (since it has no PID).
    #!/bin/bash
    . /etc/rc.conf
    . /etc/rc.d/functions
    PID=`pidof -o %PPID /usr/bin/monitorix`
    MARGS="-c /etc/monitorix.conf"
    case "$1" in
    start)
    stat_busy "Starting Monitorix"
    if [ -z "$PID" ]; then
    /usr/bin/monitorix $MARGS
    fi
    if [ ! -z "$PID" -o $? -gt 0 ]; then
    stat_fail
    else
    PID=`pidof -o %PPID /usr/bin/monitorix`
    echo $PID > /var/run/monitorix.pid
    add_daemon monitorix
    stat_done
    fi
    stop)
    stat_busy "Stopping Monitorix"
    [ ! -z "$PID" ] && kill $PID &> /dev/null
    if [ $? -gt 0 ]; then
    stat_fail
    else
    rm_daemon monitorix
    else
    rm_daemon monitorix
    stat_done
    fi
    restart)
    $0 stop
    sleep 1
    $0 start
    echo "usage: $0 {start|stop|restart}"
    esac

    According to the man page, the -p flag will let you generate a PID file.
    You have a few logical errors in your rc.d script and a syntax error (double else in stop). I've been using a template similar to the below in cleaning up a few of the packages I maintain...
    #!/bin/bash
    . /etc/rc.conf
    . /etc/rc.d/functions
    pidfile=/run/monitorix.pid
    if [[ -r $pidfile ]]; then
    read -r PID < "$pidfile"
    if [[ ! -d /proc/$PID ]]; then
    # stale pidfile
    unset PID
    rm -f "$pidfile"
    fi
    fi
    args=(-c /etc/monitorix.conf -p "$pidfile")
    case "$1" in
    start)
    stat_busy "Starting Monitorix"
    if [[ -z $PID ]] && /usr/bin/monitorix "${args[@]}"; then
    add_daemon monitorix
    stat_done
    else
    stat_fail
    exit 1
    fi
    stop)
    stat_busy "Stopping Monitorix"
    if [[ $PID ]] && kill $PID &> /dev/null; then
    rm_daemon monitorix
    stat_done
    else
    stat_fail
    exit 1
    fi
    restart)
    $0 stop
    sleep 1
    $0 start
    echo "usage: $0 {start|stop|restart}"
    esac
    please also fix the PKGBUILD:
    install=('readme.install')
    This is not valid, and pacman 4 will not let you declare install as an array.
    Last edited by falconindy (2011-09-25 15:05:02)

  • Urgeant help with a java script

    I really nead some help with an essay that i have for tommorow. Ok it goes like this: I have to build in java and with help of the awt library a proper interface that whill allow people to make reservation for tickets in a cinema. With the proper graphics the interface must allow the users to chose time , movie , date , and a spot in the cinema! the spot should be selected from a "picture" (like a diagramm or something) of the cinema which will be displayed on the screen...
    thanx in advance!!!

    What do you need "help" with? No one is going to do your homework for you here. If you have a specific question or problem, feel free to ask. You have to get started yourself though.. Thought college was going to be easy?

  • [SOLVED] Help with a simple script

    Hi guys! A problem is connected with switching cpu governors. Usually I set it by commands and made alias in .bashrc:
    sudo cpufreq-set -c 0 -g performance && sudo cpufreq-set -c 1 -g performance
    sudo cpufreq-set -c 0 -g ondemand && sudo cpufreq-set -c 1 -g ondemand
    sudo cpufreq-set -c 0 -g powersave && sudo cpufreq-set -c 1 -g powersave
    Could you help me with script which can read system information about current cpu governor and switches the next governor
    Last edited by noMaster (2012-01-27 06:36:55)

    noMaster wrote:
    JuseBox wrote:Can you please be more specific with what you are trying to accomplish?
    I need that script for set it on hotkey and change cpu states. Unfortunately I havent scripting experience
    I make one thing but it doesnt work for me
    ### Toggle Super Hybrid Engine ##################################
    she_names=("performance" "ondemand" "powersave")
    she_value_performance=( "0" "performance")
    she_value_ondemand=( "1" "ondemand")
    she_value_powersave=( "2" "powersave")
    # Find current
    she_current=`cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor`
    if [[ "${she_current}" == "${she_value_performance[0]}" ]]; then
    she_next=${she_value_ondemand[0]}
    elif [[ "${she_current}" == "${she_value_ondeman[1]}" ]]; then
    she_next=${she_value_powersave[0]}
    elif [[ "${she_current}" == "${she_value_powersave[1]}" ]]; then
    she_next=${she_value_performance[0]}
    fi
    function she_toggle() {
    if [[ "${she_names[${she_current}]}" != "${she_names[${she_next}]}" ]]; then
    cmd="/usr/bin/notify-send -t 5000 SHE changed"
    echo ${she_next} > ${she_current}
    else
    cmd="/usr/bin/notify-send -t 5000 SHE original"
    fi
    case $1 in
    # "debug")
    # print_debug
    "powersave")
    she_next=2
    she_toggle
    "normal")
    she_next=1
    she_toggle
    "performance")
    she_next=0
    she_toggle
    she_toggle
    esac
    ### End of file #################################################
    I am looking over the script. Without it, do you think you could explain what your trying to accomplish? What states and when should they toggle? Something rough to get an idea? I think if I am thinking correctly this could be easier then it seems. I will help ya.

  • Need help with PHP mail script [was: Can someone please help me?]

    I'm trying to collect data from a form and email it.  I'm using form2mail.php and the problem is that the email is not collecting the form info and it has the same email address in the From: and To: lines. I'm really stuck and would appreciate any help.
    Here is the HTML code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Contact Us</title>
    <style type="text/css">
    <!--
    .style1 {font-family: Verdana, Arial, Helvetica, sans-serif}
    .style2 {
    font-size: 14px;
    color: #000000;
    body {
    background-color: #FFFFFF;
    body,td,th {
    color: #CC3300;
    .style3 {font-size: 14px; font-weight: bold; }
    .style6 {font-size: 18px}
    .style7 {font-size: 16px}
    .style8 {font-size: 16px; font-family: Verdana, Arial, Helvetica, sans-serif; }
    .style9 {font-size: 16px; font-weight: bold; font-family: Verdana, Arial, Helvetica, sans-serif; }
    .style10 {color: #000000}
    -->
    </style>
    </head>
    <body>
    <div align="center"><img src="nav2.jpg" alt="nav bar" width="698" height="91" border="0" usemap="#Map2" />
      <map name="Map2" id="Map2">
      <area shape="rect" coords="560,9,684,38" href="accessories.html" />
    <area shape="rect" coords="456,8,548,38" href="contact.html" />
    <area shape="rect" coords="305,8,435,40" href="photog.html" />
    <area shape="rect" coords="187,9,283,39" href="services.html" />
    <area shape="rect" coords="81,10,167,39" href="aboutus.html" />
    <area shape="rect" coords="5,10,68,39" href="index.html" />
    </map>
      <map name="Map" id="Map">
        <area shape="rect" coords="9,9,69,39" href="index.html" />
        <area shape="rect" coords="83,11,165,39" href="aboutus.html" />
        <area shape="rect" coords="182,9,285,38" href="services.html" />
        <area shape="rect" coords="436,14,560,37" href="contact.html" />
        <area shape="rect" coords="563,14,682,38" href="accessories.html" />
      </map>
    </div>
    <p> </p>
    <form id="TheForm" name="TheForm" action="form2mail.php" method="post">
      <p align="center" class="style2">P<span class="style1">lease fill out form below for a &quot;free no obligation quote&quot; then click submit.</span></p>
      <p align="center" class="style3">(*Required Information)</p>
      <div align="center">
        <pre><strong><span class="style8">*Contact Name</span> </strong><input name="name" type="text" id="name" />
    <span class="style8"><strong>
    Business Name </strong></span><input name="bn" type="text" id="bn" />
    <span class="style8"><strong>*Phone Number <input type="text" name="first" size="3" onFocus="this.value='';"
        onKeyup="checkNumber(this.value); autoTab(this, document.TheForm.second);" maxlength="3" value="###" /> - <input type="text" name="second" size="3" onFocus="this.value='';" onKeyup="checkNumber(this.value); autoTab(this, document.TheForm.third);" maxlength="3" value="###" /> - <input type="text" name="third" size="4" onFocus="this.value='';" onKeyup="checkNumber(this.value); autoTab(this, document.TheForm.fourth);" maxlength="4" value="####"/> </strong></span>
    <strong><span class="style1">*</span><span class="style8">Email Address</span> <input name="email" type="text" id="email" />     </strong> </pre>
        <label><span class="style9">*Re-enter to confirm</span>
        <input name="emx" type="text" id="emx" /></label><br /><br /><span class="style9">
    <label></label>
        </span>
        <p><span class="style9">*Best time to call </span>
          <select name="name1[]" multiple size="1" >
            <option>8am-9am</option>
            <option>9am-10am</option>
            <option>10am-11am</option>
            <option>11am-12pm</option>
            <option>12pm-1pm</option>
            <option>1pm-2pm</option>
            <option>2pm-3pm</option>
            <option>3pm-4pm</option>
            <option>4pm-5pm</option>
            <option>5pm-6pm</option>
            <option>6pm-7pm</option>
            <option>7pm-8pm</option>
          </select>
          <br />
          <br />
          <span class="style9">Type of Location</span>
          <select name="name2[]" multiple size="1" >
            <option>Residential</option>
            <option>Commercial</option>
          </select>
          <br />
          <br />
            <span class="style1"><br />
            <strong><br />
              <span class="style6">*Type of Services Requested:</span></strong><br />
            </span><strong><span class="style10">(check all that apply)</span><br />
                </strong><br />
                <span class="style7"><span class="style1"><strong>Janitorial cleaning</strong></span>
                <input type="checkbox" name="checkbox[]" value="checkbox" multiple/>
                <br />
                </span><strong><br />
                  <span class="style8">Mobile Auto Detailing</span>
                <input type="checkbox" name="checkbox2[]" value="checkbox" multiple/>
                <br />
                <br />
                  </strong><span class="style9">Moving/Hauling</span>
          <input type="checkbox" name="checkbox3[]" value="checkbox" multiple/>
          <br />
          <br />
                  <span class="style9">Pressure washing</span>
          <input type="checkbox" name="checkbox4[]" value="checkbox" multiple/>
          <br />
          <br />
                  <span class="style9">Window washing</span>
          <input type="checkbox" name="checkbox5[]" value="checkbox" multiple/>
          <br />
          <br />
                  <span class="style9">Window Tinting</span>
          <input type="checkbox" name="checkbox6[]" value="checkbox" multiple/>
          <br />
          <br />
                  <span class="style9">Boat cleaning</span>
          <input type="checkbox" name="checkbox7[]" value="checkbox" multiple/>
          <br />
          <br />
                  <span class="style9">RV cleaning</span>
          <input type="checkbox" name="checkbox8[]" value="checkbox" multiple/>
          <br />
          <br />
                  <span class="style9">Motorcycle cleaning</span>
          <input type="checkbox" name="checkbox9[]" value="checkbox" multiple/>
          <br />
          <br />
          <br />
          <br />
          <input name="SB"  type="button" class="style9" value="Submit" onClick="sendOff();">
        </p>
      </div></label>
      <script language="JavaScript1.2">
    // (C) 2000 www.CodeLifter.com
    // http://www.codelifter.com
    // Free for all users, but leave in this  header
    var good;
    function checkEmailAddress(field) {
    // Note: The next expression must be all on one line...
    //       allow no spaces, linefeeds, or carriage returns!
    var goodEmail = field.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org) |(\..{2,2}))$)\b/gi);
    if (goodEmail){
       good = true
    } else {
       alert('Please enter a valid e-mail address.')
       field.focus()
       field.select()
       good = false
    function autoTab(startPoint,endPoint){
    if (startPoint.getAttribute&&startPoint.value.length==startPoint.getAttribute("max length"))
    endPoint.focus();
    function checkNumber(phoneNumber){
    var x=phoneNumber;
    var phoneNumber=/(^\d+$)|(^\d+\.\d+$)/
    if (phoneNumber.test(x))
    testResult=true
    else{
    alert("Please enter a valid number.")
    phoneNumber.focus();
    phoneNumber.value="";
    testResult=false
    return (testResult)
    function sendOff(){
       namecheck = document.TheForm.name.value   
       if (namecheck.length <1) {
          alert('Please enter your name.')
          return
       good = false
       checkEmailAddress(document.TheForm.email)
       if ((document.TheForm.email.value ==
            document.TheForm.emx.value)&&(good)){
          // This is where you put your action
          // if name and email addresses are good.
          // We show an alert box, here; but you can
          // use a window.location= 'http://address'
          // to call a subsequent html page,
          // or a Perl script, etc.
          window.location= 'form2mail.php';
       if ((document.TheForm.email.value !=
              document.TheForm.emx.value)&&(good)){
              alert('Both e-mail address entries must match.')
    </script>
    </form>
    <p> </p>
    </body>
    </html>
    and here is the form2mail.php:
    <?php
    # You can use this script to submit your forms or to receive orders by email.
    $MailToAddress = "[email protected]"; // your email address
    $redirectURL = "http://www.chucksmobile.com/thankyou.html"; // the URL of the thank you page.
    $MailSubject = "[Customer Contact Info]"; // the subject of the email
    $sendHTML = FALSE; //set to "false" to receive Plain TEXT e-mail
    $serverCheck = FALSE; // if, for some reason you can't send e-mails, set this to "false"
    # copyright 2006 Web4Future.com =================== READ THIS ===================================================
    # If you are asking for a name and an email address in your form, you can name the input fields "name" and "email".
    # If you do this, the message will apear to come from that email address and you can simply click the reply button to answer it.
    # To block an IP, simply add it to the blockip.txt text file.
    # CHMOD 777 the blockip.txt file (run "CHMOD 777 blockip.txt", without the double quotes)
    # This is needed because the script tries to block the IP that tried to hack it
    # If you have a multiple selection box or multiple checkboxes, you MUST name the multiple list box or checkbox as "name[]" instead of just "name"
    # you must also add "multiple" at the end of the tag like this: <select name="myselectname[]" multiple>
    # you have to do the same with checkboxes
    Web4Future Easiest Form2Mail (GPL).
    Copyright (C) 1998-2006 Web4Future.com All Rights Reserved.
    http://www.Web4Future.com/
    This script was written by George L. & Calin S. from Web4Future.com
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
    # DO NOT EDIT BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE DOING ===================================================
    $w4fver =  "2.2";
    $ip = ($_SERVER['HTTP_X_FORWARDED_FOR'] == "" ? $_SERVER['REMOTE_ADDR'] : $_SERVER['HTTP_X_FORWARDED_FOR']);
    //function blockIP
    function blockip($ip) {
    $handle = @fopen("blockip.txt", 'a');
    @fwrite($handle, $ip."\n");
    @fclose($handle);
    $w4fx = stristr(file_get_contents('blockip.txt'),getenv('REMOTE_ADDR'));
    if ($serverCheck) {
    if (preg_match ("/".str_replace("www.", "", $_SERVER["SERVER_NAME"])."/i", $_SERVER["HTTP_REFERER"])) { $w4fy = TRUE; } else { $w4fy = FALSE; }
    } else { $w4fy = TRUE; }
    if (($w4fy === TRUE) && ($w4fx === FALSE)) {
    $w4fMessage = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\"><html>\n<head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\"></head><body><font face=3Dverdana size=3D2>";
    if (count($_GET) >0) {
    reset($_GET);
    while(list($key, $val) = each($_GET)) {
      $GLOBALS[$key] = $val;
      if (is_array($val)) {
       $w4fMessage .= "<b>$key:</b> ";
       foreach ($val as $vala) {
        $vala =stripslashes($vala);
        $vala = htmlspecialchars($vala);
        if (trim($vala)) { if (stristr($vala,"Content-Type:") || stristr($vala,"MIME-Version") || stristr($vala,"Content-Transfer-Encoding") || stristr($vala,"bcc:")) { blockip($ip); die("ILLEGAL EXECUTION DETECTED!"); } }
        $w4fMessage .= "$vala, ";
       $w4fMessage .= "<br>\n";
      else {
       $val = stripslashes($val);
       if (trim($val)) { if (stristr($val,"Content-Type:") || stristr($val,"MIME-Version") || stristr($val,"Content-Transfer-Encoding") || stristr($val,"bcc:")) { blockip($ip); die("ILLEGAL EXECUTION DETECTED!"); } }
       if (($key == "Submit") || ($key == "submit")) { } 
       else {  if ($val == "") { $w4fMessage .= "$key: - <br>\n"; }
         else { $w4fMessage .= "<b>$key:</b> $val<br>\n"; }
    } // end while
    }//end if
    else {
    reset($_POST);
    while(list($key, $val) = each($_POST)) {
      $GLOBALS[$key] = $val;
      if (is_array($val)) {
       $w4fMessage .= "<b>$key:</b> ";
       foreach ($val as $vala) {
        $vala =stripslashes($vala);
        $vala = htmlspecialchars($vala);
        if (trim($vala)) { if (stristr($vala,"Content-Type:") || stristr($vala,"MIME-Version") || stristr($vala,"Content-Transfer-Encoding") || stristr($vala,"bcc:")) {blockip($ip); die("ILLEGAL EXECUTION DETECTED!"); } }   
        $w4fMessage .= "$vala, ";
       $w4fMessage .= "<br>\n";
      else {
       $val = stripslashes($val);
       if (trim($val)) { if (stristr($val,"Content-Type:") || stristr($val,"MIME-Version") || stristr($val,"Content-Transfer-Encoding") || stristr($val,"bcc:")) {blockip($ip); die("ILLEGAL EXECUTION DETECTED!"); } }
       if (($key == "Submit") || ($key == "submit")) { } 
       else {  if ($val == "") { $w4fMessage .= "$key: - <br>\n"; }
         else { $w4fMessage .= "<b>$key:</b> $val<br>\n"; }
    } // end while
    }//end else
    $w4fMessage .= "<font size=3D1><br><br>\n Sender IP: ".$ip."</font></font></body></html>";
        $w4f_what = array("/To:/i", "/Cc:/i", "/Bcc:/i","/Content-Type:/i","/\n/");
    $name = preg_replace($w4f_what, "", $name);
    $email = preg_replace($w4f_what, "", $email);
    if (!$email) {$email = $MailToAddress;}
    $mailHeader = "From: $name <$email>\r\n";
    $mailHeader .= "Reply-To: $name <$email>\r\n";
    $mailHeader .= "Message-ID: <". md5(rand()."".time()) ."@". ereg_replace("www.","",$_SERVER["SERVER_NAME"]) .">\r\n";
    $mailHeader .= "MIME-Version: 1.0\r\n";
    if ($sendHTML) {
      $mailHeader .= "Content-Type: multipart/alternative;";  
      $mailHeader .= "  boundary=\"----=_NextPart_000_000E_01C5256B.0AEFE730\"\r\n";    
    $mailHeader .= "X-Priority: 3\r\n";
    $mailHeader .= "X-Mailer: PHP/" . phpversion()."\r\n";
    $mailHeader .= "X-MimeOLE: Produced By Web4Future Easiest Form2Mail $w4fver\r\n";
    if ($sendHTML) {
      $mailMessage = "This is a multi-part message in MIME format.\r\n\r\n";
      $mailMessage .= "------=_NextPart_000_000E_01C5256B.0AEFE730\r\n";
      $mailMessage .= "Content-Type: text/plain;   charset=\"ISO-8859-1\"\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\n";  
      $mailMessage .= trim(strip_tags($w4fMessage))."\r\n\r\n";  
      $mailMessage .= "------=_NextPart_000_000E_01C5256B.0AEFE730\r\n";  
      $mailMessage .= "Content-Type: text/html;   charset=\"ISO-8859-1\"\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\n";  
      $mailMessage .= "$w4fMessage\r\n\r\n";  
      $mailMessage .= "------=_NextPart_000_000E_01C5256B.0AEFE730--\r\n";  
    if ($sendHTML === FALSE) {
      $mailHeader .= "Content-Type: text/plain;   charset=\"ISO-8859-1\"\r\nContent-Transfer-Encoding: quoted-printable\r\n\r\n";  
      $mailMessage .= trim(strip_tags($w4fMessage))."\r\n\r\n";  
    if (!mail($MailToAddress, $MailSubject, $mailMessage,$mailHeader)) { echo "Error sending e-mail!";}
    else { header("Location: ".$redirectURL); }
    } else { echo "<center><font face=verdana size=3 color=red><b>ILLEGAL EXECUTION DETECTED!</b></font></center>";}
    ?>
    Thanks in advance,
    Glenn
    [Subject line edited by moderator to indicate nature of request]

    Using PHP to process an online form and send the input by email is very simple. The mail() function takes a minimum of three arguments, namely: the address the mail is being sent to, the subject line, and the body of the email as a single string. The reason some people use scripts like form2mail.php is because they don't have the knowledge or patience to validate the user input to make sure it's safe to send.
    Rather than attempt to trawl through your complex form looking for the problems, I would suggest starting with a couple of simple tests.
    First of all, create a PHP page called mailtest.php containing the following script:
    <?php
    $to = '[email protected]'; // use your own email address
    $subject = 'PHP mail test';
    $message = 'This is a test of the mail() function.';
    $sent = mail($to, $subject, $message);
    if ($sent) {
      echo 'Mail was sent';
    } else {
      echo 'Problem sending mail';
    ?>
    Save the script, upload it to your server, and load it into a browser. If you see "Mail is sent", you're in business. If not, it probably means that the hosting company insists on the fifth argument being supplied to mail(). This is your email address preceded by -f. Change the line of code that sends the mail to this:
    $sent = mail($to, $subject, $message, null, '[email protected]');
    Obviously, replace "[email protected]" with your own email address.
    If this results in the mail being sent successfully, you will need to adapt the code in form2mail.php to accept the fifth parameter. You need to change the following line, which is a few lines from the end of the script:
    if (!mail($MailToAddress, $MailSubject, $mailMessage,$mailHeader))
    Change it to this:
    if (!mail($MailToAddress, $MailSubject, $mailMessage,$mailHeader, '[email protected]'))
    Again, use your own email address instead of "[email protected]".
    Once you have determined whether you need the fifth argument, test form2mail.php with a very simple form like this:
    <form id="form1" name="form1" method="post" action="form2mail.php">
      <p>
        <label for="name">Name:</label>
        <input type="text" name="name" id="name" />
      </p>
      <p>
        <label for="email">Email:</label>
        <input type="text" name="email" id="email" />
      </p>
      <p>
        <label>
          <input type="checkbox" name="options[]" value="boat cleaning" id="options_0" />
          Boat cleaning</label>
        <br />
        <label>
          <input type="checkbox" name="options[]" value="RV cleaning" id="options_1" />
          RV cleaning</label>
        <br />
        <label>
          <input type="checkbox" name="options[]" value="motorcycle cleaning" id="options_2" />
          Motorcycle cleaning</label>
      </p>
      <p>
        <input type="submit" name="send" id="send" value="Submit" />
      </p>
    </form>
    If that works, you can start to make the form more complex and add back your JavaScript validation.

  • Need help with a basic script to resize image then resize the canvas

    I am new to photoshop scripting, and have come across a need to force an image to be 8"x10" at 300dpi (whether it is vertical or horizontal)
    I need to maintain the correct orientation in the file, so an Action will not work, I believe I have to implement a script to accomplish this.
    I have the below script so far, but I am not certain of how to input the variables / paramters
    doc = app.activeDocument;
    if (doc.height > doc.width) doc.resizeImage("2400 pixels","3600 pixels", "300", "BICUBIC");
    if (doc.height > doc.width) doc.resizeCanvas("2400 pixels","3000 pixels", "MIDDLECENTER");
    if (doc.height < doc.width) doc.resizeImage("3600 pixels","2400 pixels",300,"BICUBIC");
    if (doc.height < doc.width) doc.resizeCanvas(3000,2400,"MIDDLECENTER");
    When I run this script, I get the following error:
    Error 1245: Illegal argument - argument 4
    - Enumerated value expected
    Line: 5
    if (doc.height < doc.width) doc.resizeImage("3600 pixels","2400 pixels",300,"BICUBIC");
    The fact that its failing on lien 5 lets nme know that I have the "If" portions of my script correct, I just dont know how to accomplish the functions correctly.
    Any help would be appreciated!
    Thanks,
    Brian

    I know I'm late here but it seems to me your trying to automate a 8"x10 or 10"x8 300DPI  print.
    To do that you must first crop your image to a 4:5 aspect ratio to prevent distortion unless your shooting with a 4" by 5" camera.   I wrote a Plugin script a couple years ago that could help you do a centered crop.  You could do the whole process by recording a simple Photoshop action that uses two  Plugin Scripts only four steps would be needed.
    Step 1 Menu File>Automate>AspectRatioSelection  (My script based of Adobe Fit Image Plugin script) Set 4:5 Aspect ratio, center,  Rectangle, Replace, no feather. Llike Fit Image this script woks on both Landscape and Portrait images. The Selection will be correct for the images orientation.
    Step 2 Menu Image>Crop
    Step 3 Menu File>Automate>Fit Image set 3000 PX height and 3000 PX width the Image will be Resample so its longest side will be 3000 pixels.  Adobe Fit Image Plugin Script always uses BICUBIC resampling.  I have a modified version of Fit Image  that uses Bicubic Sharper whebndownsizing and BicubicSmoother when up sizing.
    Step 4 Menu Image>Size un check resample set resolution to 300 DPI.
    When you play the actions the Script Dialogs will not be displayed and the setting use when you recorded the action will ne used.
    The Plugin Script are included in my crafting actions package:
    http://www.mouseprints.net/old/dpr/JJMacksCraftingActions.zip
    Contains:
    Action Actions Palette Tips.txt
    Action Creation Guidelines.txt
    Action Dealing with Image Size.txt
    Action Enhanced via Scripted Photoshop Functions.txt
    CraftedActions.atn Sample Action set includes an example Watermarking action
    Sample Actions.txt Photoshop CraftedActions set saved as a text file. This file has some additional comments I inserted describing how the actions work.
    12 Scripts for actions
    My other free Photoshop downloads cam be found here: http://www.mouseprints.net/Photoshop.html

  • Please help with an ICM script editor syntax question.

    I need to modify a set variable node.  What I have now is Call.PeripheralVariable8+".wav" and this works.  What I need it to say is Call.PeripheralVariable8+anything+".wav" but when I insert an * for the anything it's seen as a multiplier.  What's the syntax to do this?  The anything I need to add is _9xxx where xxx are other numbers, but the _9 will be in all, if that helps any.  Thanks in advance !!

    You can use the concatenate() function to build up your string, as you no doubt know.
    As far as the wildcard goes ... your intention must be to try to SET the call variable and later on test the call variable with an IF node. Is that right?
    You would be able to test parts of the string using the substr() function - which is based on character position. If that is a fixed value that you know, it's easy. If it's not, you can first use the find() function to locate something (like the "_9"), returning the position, and then use the substr() function to pull it off.
    Can you write some pseudo-code here to define exactly your intention? You can set up a dummy script and send a dummy call through using Call Tracer and watch the output to see how your code is working.
    Regards,
    Geoff

  • Help with PSexec command

    Hi everyone so I have this script that pulls a file from another machine and then unzips it.
    function Expand-ZIPFile($file, $destination)
    $shell = new-object -com shell.application
    $zip = $shell.NameSpace($file)
    foreach($item in $zip.items())
    $shell.Namespace($destination).copyhere($item)
    #Create directory
    New-Item -ItemType directory -Path "C:\Users\Public\Desktop\Android sdk" -Force
    #Move zip to directory
    Copy-Item "\\tsvc2552142x011\C`$\Users\cody-horton\Desktop\adt.7z" "C:\Users\Public\Desktop\Android sdk" `
    -Recurse -Force
    #Unzip file
    Expand-ZIPFile –File "C:\Users\Public\Desktop\Android sdk\adt.7z" `
    –Destination "C:\Users\Public\Desktop\Android sdk"
    #Delete zip folder
    Remove-Item "C:\Users\Public\Desktop\Android sdk\adt.7z" -Recurse
    So it works but I'm having trouble using the PSexec command. I can successfully open up the computers command prompt by using psexec  "computer name" cmd. Then if I try to run my script it doesn't work. 
    I'm not sure what I'm doing wrong or if there was a better way to do this. Thanks any help is appreciated.

    Hi thanks for the reply. I was using this command once I was using the other machines command prompt runas/user:UserName"ProgramNamePathToProgramFile"
     So I would put my user name which is an admin in AD then the path to the ps1 file I wanted to execute.

  • Would like help with trap command in Terminal

    I'm learning about the trap command from my bash book. I tried out the little script they gave:
    Code: 
    trap "echo 'You hit control-C!' " INTwhile true; do     sleep 60done
    But when I type control-c, the script just stops and the message is not displayed. I checked trap -l and saw that control-c is intr, but the same thing happened whet I tried that. Can anyone tell me what I'm missing?
    I'm using terminal (BSD) in OS X Snow Leopard

    I'm assuming that you are typing these commands in the terminal window and not initiating them thru a shell script. I'd like to suggest that you avoid infinite loops. Since you are bound to orphan processes. I'm going the use the external sleep command in my examples because it affords us some time to type CONTROL-C.
    [bash-4.2.8]~ $ trap "echo '......You hit control-C'" INT; sleep 15
    ^C  
    [bash-4.2.8]~ $
    [bash-4.2.8]~ $ ^C......You hit control-C
    The trap is set but Bash does not intercept the trap because sleep is running in the foreground. The interrupt signal is sent to the command sleep.
    Let's try running sleep in the background ->
    [bash-4.2.8]~ $ trap 2 #Set SIGINT to it's default
    [bash-4.2.8]~ $ trap "echo '......You hit control-C'" INT; sleep 15&
    [1] 368
    [bash-4.2.8]~ $ ^C......You hit control-C
    [bash-4.2.8]~ $ ^C......You hit control-C
    [1]+  Done                    sleep 15
    [bash-4.2.8]~ $ ^C......You hit control-C
    It works! Well, almost. You can't send the interrupt signal to a background process. In order for Bash to intercept the trap it must stay in the foreground. This happens when you initiate a sub-shell via a shell script or by rapping a command in paretheses ( ) ->
    [bash-4.2.8]~ $ trap 2  #Set SIGINT to it's default
    [bash-4.2.8]~ $ (trap "echo '......You hit control-C'" INT; sleep 15) ^C......You hit control-C
    [bash-4.2.8]~ $
    [bash-4.2.8]~ $ ^C
    The trap works and the interrupt signal was sent to sleep. Notice, the trap is only set in the sub-shell.
    Bash behaves differently when you use the built-in commands since you are working within the shell. I'll use an example similar to one of yours, except that you can break out of the loop by typing the number 10 or higher.
    [bash-4.2.8]~ $ trap "echo '.......You hit control-C'" INT ; x=0; while (( $x < 10 )); do echo "Enter a number"; read x; done
    Enter a number
    3
    Enter a number
    ^C.......You hit control-C
    3
    Enter a number
    10
    [bash-4.2.8]~ $
    [bash-4.2.8]~ $ ^C......You hit control-C
    [bash-4.2.8]~ $ trap 2  #Set SIGINT to it's default
    As you can see the trap works. I'm going to let you sort out what happens after I typed  CONTROL -C in the last example.....:-)  Hope this helps.
    Message was edited by: Mark Jalbert

Maybe you are looking for

  • Offset account name not coming in G/L printout

    Hi, We have SBO 2005B PL25 in the G/L printout the offset acount code is coming through systm variable 74 but the acount name is not coming even after using system variable 415 please help with a workaround as we urgntly need the printed cash books r

  • XML-Document with extern DTD

    Hello! How can the Oracle XML-Parser parse a XML-Document without the XML-Declaration. There is no information about the Version and the DTD in the XML-Document. Can I use an extern DTD? Thanks, Peter null

  • Interfaces R3 - SCM APO with qrfc

    Hi, We have some interfaces from  R3 to  SCM APO system  which actually runs with tRFC. We want to change it to a qRFC scenario. I've configured queues and systems as documentation http://help.sap.com/saphelp_scm41/helpdata/en/13/747b3704716066e10000

  • Dynamic button text in dynpro

    i have a dynpro containing a tabstrip control i would make the tab title sequence dynamic as the tab title are pushbutton i have thought to make the pushbutton text dynamic how can i do it? i'm sure it's possible to do it in selection screen thanks!!

  • HT204023 i have iphone 3gs (5.1.1) but there is no Personal Hotspot please help me what must i do

    what must i do please help me there is no personal hotspot