Scripts for setting mail message colors quickly

I've been frustrated at how difficult it is to set the color of a message subject etc in a mailbox. Sometimes applying a color would work, sometimes not, and many clicks required. Finally I wrote a simple script that appears in the Finder's Scripts menu, which applies a particular color to all emails that are selected. I made one version for each color I use (I use these to keep track of emails that are useful references, or that require some action, etc.) I added a leading space to the script names so they would appear at the top of the scripts menu. I wish I could connect them to buttons in the Mail window, but don't know a way to do that, and this is nearly as conveniet.
Here's one of the scripts. Colors can be none, red, orange, blue, gray, green, purple, yellow:
tell application "Mail"
set selectedMessages to selection
set nm to count of selectedMessages
if (nm) is equal to 0 then
display alert "No Messages Selected" message "Select the message(s) you want to color red before running this script."
else
repeat with nn from 1 to nm by 1
set theMessage to item nn of selectedMessages
set the background color of theMessage to red
end repeat
end if
end tell

HI Disha
Check out these links. They will surely help
http://www.geocities.com/mpioud/Z_EMAIL_ABAP_REPORT.html
http://www.thespot4sap.com/Articles/SAP_Mail_SO_Object_Send.asp
If you find this answer useful, please reward me for the same.
Good luck
Karthik Potharaju

Similar Messages

  • Shortcuts for filing mail messages into mailboxes

    I just switched from ThinkPad to MacBook Air, and from Thunderbird to Apple Mail. I have a big hierarchy of mailboxes (several thousand of them). It is time-consuming to drag a mail message through the hierarchy into the appropriate mailbox. In Thunderbird, I had a plug-in that allowed me to quickly file mail messages into appropriate mailboxes by simply typing a few letters of the mailbox name. Is there anything similar for Apple Mail (or any other tricks for filing mail messages more quickly)?
    Thanks for your help.
    M....

    Thanks for your response.
    Actually, the plug-in for Thunderbird works quite well, even with thousands of mailboxes. You type in a few letters from the mailbox name (not necessarily the first letters) and it shows a list of all mailboxes whose names include those letters.
    If someone could create a plug-in like this for Apple Mail, I think it could be very useful.

  • Simple/silly question: how do I set/change default font/color for outgoing mail messages?

    Simple/silly question: how do I set/change default font/color for outgoing mail messages?

    Just a suggestion..........
    Download Thunderbird.  Easier to use when it comes to what you want to do w/your emails. 

  • Script for forward mail as attachment

    Hi,
    I think there is no direct call for creating forward mail as attachment. I tried "forward" reply and other things.Its working fine.
    Please let me know if any one have idea for creating script for apple mail "forward as attachment".

    hm... perhaps these two functions do what you wanna do :-/
    on createmail_emlx_files_attachment_ofselection()
    tell application "Mail"
    -- get the mail selection
    set myMessages to selection
    --do it to every selected mail
    repeat with m in myMessages
    --get the folder where the emlx file is stored in
    set mypath to quoted form of POSIX path of ((account directory of account of mailbox of m) as alias)
    --get the id of that message (should be unique within each account)
    set myid to id of m
    --find the folder where this unique email (by id) is stored in
    set myfolder to quoted form of (paragraph 1 of (do shell script "find " & mypath & " -name '" & myid & ".emlx' -exec dirname {} \\;"))
    --create a compressed tar archive of this message and open this gzipped files with Apple Mail (-> attach it to a new message).
    do shell script "cd " & myfolder & ";tar -rf " & myid & ".tar " & myid & ".emlx;gzip " & myid & ".tar;mv " & myid & ".tar.gz /tmp/;open -a /Applications/Mail.app /tmp/" & myid & ".tar.gz"
    end repeat
    end tell
    end createmail_emlx_files_attachment_ofselection
    on createmail_source_attachment_ofselection()
    tell application "Mail"
    -- get the mail selection
    set myMessages to selection
    --do it to every selected mail
    repeat with m in myMessages
    set myid to id of m
    set mysource to quoted form of ((source of m) as text)
    do shell script "cd /tmp/;echo " & mysource & "|cat>/tmp/" & myid & ".txt;gzip " & myid & ".txt;open -a /Applications/Mail.app " & myid & ".txt.gz"
    end repeat
    end tell
    end createmail_source_attachment_ofselection

  • Script for getting mail if database is down

    Hi Friends,
    OS Version : IBM AIX 5,2
    Oracle version : 9.2.0.7
    I am executing the following script for getting mail alert if database is down. some how the script is not working
    check_stat=`ps -ef|grep ${ORACLE_SID}|grep pmon|wc -l`;
    oracle_num=`expr $check_stat`
    if [ $oracle_num -lt 1 ]
    then
    exit 0
    fi
    # Test to see if Oracle is accepting connections
    $ORACLE_HOME/bin/sqlplus -s "/as sysdba" > /tmp/check_$ORACLE_SID.ora
    select name from v$database;
    exit
    # If not, exit and e-mail . . .
    check_stat=`cat /tmp/check_$ORACLE_SID.ora|grep -i error|wc -l`;
    oracle_num=`expr $check_stat`
    if [ $oracle_num -ne 0 ]
    then
    mailx -s "$ORACLE_SID is down!" [email protected] < /tmp/check_$ORACLE_SID.ora
    exit 16
    fi
    I am saving this as .sh file and executing at command prompt. It is just hanging, but not throwing any error.
    I would like to know if there is anything to be modified in the script or please provide me any such script. Thanks in advance

    HI there.
    I have a script I use that works really well. It sends out an email only if the database is down and also reads an ini file to process a blackout period and a priority level of the database... High priority databases are monitored every 5 minutes and Medium priority databases every hour.
    There are two scripts, the shell script and the .ini file and I have two cron entries...
    Check script:_
    #!/bin/ksh
    # check_oracle_status.sh
    # Script to check if Oracle db's are up and running.
    # Script is passed a priority field and reads check_oracle_status.ini
    # to determine which db's to check. If db is down an email is sent.
    # Priority Levels:
    # H - Checks db's with "H"igh Priority every 5 minutes (cron)
    # M - Checks db's with "M"edium Priority every hour (cron)
    # L - db's with "L"ow Priority currently not checked
    # Script Change History:
    # ======================
    # October 29th, 2009 - Initial Creation
    # Set environment
    export SCRIPTHOME=/opt/oracle/admin/scripts
    export INIFILE=$SCRIPTHOME/check_oracle_status.ini
    export PRIORITY=$1
    . $HOME/.profile
    db=`grep -i ":$PRIORITY" $INIFILE | cut -d":" -f1`
    check_database()
    sqlplus <<! > $SCRIPTHOME/check.out
    / as sysdba
    select * from dba_data_files;
    exit
    grep ORA- $SCRIPTHOME/check.out > $SCRIPTHOME/error.out
    if (( $? )); then
    echo ""
    else
    mailx -s "Oracle instance $i is currently UNAVAILABLE" +<email address>+ < $SCRIPTHOME/error.out
    fi
    for i in $db ; do
    fields=`grep $i $INIFILE | awk -F':' '{ total = total + NF }; END {print total}'`
    export ORACLE_SID=$i
    if [ $fields -gt 2 ]; then
    BLACKOUT_START=`grep -i "$ORACLE_SID" $INIFILE | cut -d":" -f3`
    BLACKOUT_END=`grep -i "$ORACLE_SID" $INIFILE | cut -d":" -f4`
    CURRENT_HOUR=`date +%H`
    CHECK_BASE=YES
    if [ $BLACKOUT_START -gt $BLACKOUT_END ]; then
    (( $CURRENT_HOUR >= $BLACKOUT_START || $CURRENT_HOUR <= $BLACKOUT_END )) && CHECK_BASE=
    else
    (( $CURRENT_HOUR >= $BLACKOUT_START && $CURRENT_HOUR <= $BLACKOUT_END )) && CHECK_BASE=
    fi
    if [ -n "$CHECK_BASE" ]; then
    check_database
    fi
    else
    check_database
    fi
    done
    rm $SCRIPTHOME/check.out $SCRIPTHOME/error.out
    INI File:_
    oracle1:L
    oracle2:M:17:08
    oracle3:M
    oracle5:M:17:08
    oracle6:H
    oracle7:M:17:08
    oracle8:M
    oracle9:M
    Where oracle1,2,3 etc is your sid
    L M and H your priority level
    17 is blackout start (5 PM)
    08 is blackout end (8 AM)
    Note: Blackout is just a start hour and an end hour and must contain both or none and my script can only process one blackout per database. I guess if you
    needed a second blackout you could add another line with different times for that sid
    Cron entries:_
    # Check Oracle Status
    # The check_oracle_status.sh script monitors "H"igh priority databases every 5 minutes
    # and "M"edium priority databases every hour
    0,5,10,15,20,25,30,35,40,45,50,55 * * * * /opt/oracle/admin/scripts/check_oracle_status.sh H > /dev/null 2>&1
    0 * * * * /opt/oracle/admin/scripts/check_oracle_status.sh M > /dev/null 2>&1
    Not sure if you require blackouts or priority levels but this setup works great at our site.
    Hope this helps.

  • How do i Set password for Facebook, mail, messages in iPad

    I have young children that play on my iPad. I want to restrict their access to my mail, messages and Facebook.
    Anyone, please help!

    Settings> General> Restrictions
    Online iOS 5 / iPad user interface guide:  http://help.apple.com/ipad/5/interface/
    http://help.apple.com/ipad/5/interface/Online, downloadable PDF iOS / iPad user guide:  http://manuals.info.apple.com/en_US/ipad_user_guide.pdf
    http://manuals.info.apple.com/en_US/ipad_user_guide.pdfOr you can download the free iOS 5 / iPad user guide from iBooks.

  • FM required for setting the message body with values from table

    Hi all,
      I have a retq wherein in tcode VL31n when i create the IBD,after saving the document,i need to send a mail to few people in the FI dept with the foll deatils:
    Inbound delivery no.
    A. Bill of Lading no.
    B. Bill of Lading date
    C. No. of containers
    D. Invoice no.
    E. Invoice date
    F. Supplier name
    G. Vessel name
    H. Name of the receiving port
    I. Final Destination,,
    J. Expected date of arrival
      The method used is SAVE_AND_PUBLISH_DOCUMENT.i get all these deatils in the table it_xlikp.But is there  any FM by means of which i cna read these  values and set the message body with these values and send this  as  a mail using the FM SO_DOCUMENT_SEND_API1?Full points will be  awarded..Any help is appreciated..
    Regards,
    Disha.

    HI Disha
    Check out these links. They will surely help
    http://www.geocities.com/mpioud/Z_EMAIL_ABAP_REPORT.html
    http://www.thespot4sap.com/Articles/SAP_Mail_SO_Object_Send.asp
    If you find this answer useful, please reward me for the same.
    Good luck
    Karthik Potharaju

  • Help on preparing shell script for setting the listener password

    Hi All,
    I am working on checking all my DB servers listeners and if the password is not set for the listener then I need to set the password for that.
    As we have many servers, I am planning to prepare the shell script for doing this task.
    I am familiar with setting up the listener password manually, but strucked up to prepare the shell script to do the same task.
    Can any one kindly help me on this.
    Thanks in advance,
    Mahi

    815537 wrote:
    Could any body please help me.
    Thanks,
    MahiPatience, Grasshopper
    This forum is not a chat line, and it is not paid support.
    No one is responsible for monitoring it and giving a quick response.
    Furthermore, it is a global forum. The person with the information you seek may very well live 20 time zones away from you and was going to bed just as you posted. He will not even see your post for several more hours.
    Your original post went up in the middle of the night for half the world.
    No one with the information you seek is deliberately withholding it until you sound sufficiently desperate.

  • Automated script for setting authorization limit in GL

    Hi,
    I am trying to create an automated script in our General Ledger application to set authorization limit. I have looked into code of form GLXSTEAL.fmb. There I found that, GL_AUTHORIZATION_LIMITS_PKG is being used for setting authorizations limit.
    Below is the code I am trying to run from PL/SQL developer using apps id:
    declare
    l_Rowid varchar2(30);
    l_Set_Of_Books_Id apps.GL_AUTHORIZATION_LIMITS.SET_OF_BOOKS_ID%TYPE;
    l_Employee_Id apps.GL_HR_EMPLOYEES_CURRENT_V.EMPLOYEE_ID%TYPE;
    l_Authorization_Limit apps.GL_AUTHORIZATION_LIMITS.AUTHORIZATION_LIMIT%TYPE;
    l_user_id number := FND_GLOBAL.USER_ID;
    l_login number :=FND_GLOBAL.login_id;
    p_Attribute1 apps.GL_AUTHORIZATION_LIMITS.Attribute1%TYPE;
    p_Attribute2 apps.GL_AUTHORIZATION_LIMITS.Attribute2%TYPE;
    p_Attribute3 apps.GL_AUTHORIZATION_LIMITS.Attribute3%TYPE;
    p_Attribute4 apps.GL_AUTHORIZATION_LIMITS.Attribute4%TYPE;
    p_Attribute5 apps.GL_AUTHORIZATION_LIMITS.Attribute5%TYPE;
    p_Attribute6 apps.GL_AUTHORIZATION_LIMITS.Attribute6%TYPE;
    p_Attribute7 apps.GL_AUTHORIZATION_LIMITS.Attribute7%TYPE;
    p_Attribute8 apps.GL_AUTHORIZATION_LIMITS.Attribute8%TYPE;
    p_Attribute9 apps.GL_AUTHORIZATION_LIMITS.Attribute9%TYPE;
    p_Attribute10 apps.GL_AUTHORIZATION_LIMITS.Attribute10%TYPE;
    p_Attribute11 apps.GL_AUTHORIZATION_LIMITS.Attribute11%TYPE;
    p_Attribute12 apps.GL_AUTHORIZATION_LIMITS.Attribute12%TYPE;
    p_Attribute13 apps.GL_AUTHORIZATION_LIMITS.Attribute13%TYPE;
    p_Attribute14 apps.GL_AUTHORIZATION_LIMITS.Attribute14%TYPE;
    p_Attribute15 apps.GL_AUTHORIZATION_LIMITS.Attribute15%TYPE;
    p_Context apps.GL_AUTHORIZATION_LIMITS.context%TYPE;
    l_date date :=sysdate;
    begin
    GL_AUTHORIZATION_LIMITS_PKG.Insert_Row(
    p_Rowid => l_Rowid,
    p_Set_Of_Books_Id => 1001,
    p_Employee_Id => 9236,
    p_Authorization_Limit => 100,
    p_Last_Update_Date => l_date,
    p_Last_Updated_By => l_user_id,
    p_Creation_Date => l_date,
    p_Created_By => l_user_id,
    p_Last_Update_Login => l_login,
    p_Attribute1 => p_Attribute1,
    p_Attribute2 => p_Attribute2,
    p_Attribute3 => p_Attribute3,
    p_Attribute4 => p_Attribute4,
    p_Attribute5 => p_Attribute5,
    p_Attribute6 => p_Attribute6,
    p_Attribute7 => p_Attribute7,
    p_Attribute8 => p_Attribute8,
    p_Attribute9 => p_Attribute9,
    p_Attribute10 => p_Attribute10,
    p_Attribute11 => p_Attribute11,
    p_Attribute12 => p_Attribute12,
    p_Attribute13 => p_Attribute13,
    p_Attribute14 => p_Attribute14,
    p_Attribute15 => p_Attribute15,
    p_Context => p_Context );
    commit;
    end;
    I am getting the error PLS-00306: wrong number or types of arguments in call to 'INSERT_ROW'.
    Please help me with this.
    Thanks

    I have found another way to achieve this. By inserting the data directly to GL_AUTHORIZATION_LIMITS table.
    INSERT INTO gl.GL_AUTHORIZATION_LIMITS
    (set_of_books_id,employee_id,authorization_limit,CREATION_DATE,CREATED_BY,LAST_UPDATE_DATE,LAST_UPDATED_BY,LAST_UPDATE_LOGIN)
    VALUES (1001,p_person_id,1.00,SYSDATE,l_user_id,SYSDATE,l_user_id,l_login);

  • Script for generating warning message during Shutdown by GPO

    Hello,
    I want to apply GPO in my AD to generate a warning message in the pop-up window just after when user click SHUT-DOWN  in their system .
    But I don't know what are the script for the same in batch file. Any body please suggest me.
    Thanks 

    Hello,
    i know the process how to apply it , the only things i have a problem is the content of script  as i mentioned above and now below also. I shown the script above which i used so far here only i need how to improve my script .
    echo msgbox "Hey! Here is a message!" > %tmp%\tmp.vbs
    cscript /nologo %tmp%\tmp.vbs del %tmp%\tmp.vbs
    Thanks

  • A small wrapper script for setting the lib32-gtk environment.

    Hi all,
    i've created a small script [1], which sets the gtk2 environment for
    lib32 applications.
    Thanks to buttons and alexwizard...
    just put run_bin32_gtk before the app command.
    I use this script for QT4 apps mostly, for instance:
    run_bin32_gtk opera
    or
    run_bin32_gtk skype --disable-cleanlooks
    so it fits best in my gnome environment...
    best wishes
    [1] http://aur.archlinux.org/packages.php?ID=27419

    I did something similar a couple of months ago, but instead of attempting to be clever and guessing what the background image is supposed to be, I just write it in the filename. Since some pictures just end up being too bright (or whatever) when used as a background to a urxvt terminal, I added some extra parameters for setting gamma, brightness, tint and the direction the image should be rendered. It relies on hsetroot for actually rendering the picture.
    #!/usr/bin/python
    # set-background
    import sys, os, string, re
    patterns = [ (re.compile("t-([a-f\d]+)"), lambda x: "-tint \#" + x)
    , (re.compile("b-([\d]+)"), lambda x: "-brightness -0." + x)
    , (re.compile("g-([\d]+)"), lambda x: "-gamma "+ x)
    , (re.compile("f-(v|h|d)"), lambda x: "-flip" + x)
    def buildCommand(file):
    output = ["hsetroot"]
    output.append("-" + (string.split(file,".")[-2]))
    output.append(file)
    for token in string.split(file,".")[1:-2]:
    for (pat,f) in patterns:
    if pat.match(token):
    output.append( f(pat.findall(token)[0]))
    return string.join(output)
    print buildCommand(img)
    os.system(buildCommand(img))
    # vim:set et:
    So for instance, an image with the name background.t-704214.f-v.full.jpg would be rendered as a stretched image, flipped vertically with a sepia tint. The files are required to be in the following format NAME.(MODIFIER.)*TYPE.SUFFIX, where the the order and number of modifiers are unimportant. The gamma values are somewhat unintuitive, but I guess you'll just have to play around with it to get it right.
    And to randomize the whole thing, I just used the following script in my .xinitrc to randomly pick a image from a folder.
    #!/bin/bash
    bg_folder="$HOME/.backgrounds";
    pics=($(ls $bg_folder))
    let "n = $RANDOM % ${#pics[@]}"
    (cd $bg_folder; set-background ${pics[$n]})

  • A script for setting a random wallpaper

    I've cooked up this small bash script for changing the wallpaper to a random one from a specified directory (it is recursive)
    The script tries to be smart in determining whether the wallpaper should be scaled, centered or tiled.
    Just configure it and try it out.
    Anyway, here goes:
    #!/bin/bash
    # Random wallpaper setter, by moljac024
    # Configuration
    # Wallpaper directory
    wpDir="$HOME/Wallpapers"
    # Wallpaper list path
    wpList=$HOME/.wallpaper-list
    # Folders to be skipped, you can put as many as you like
    #wpSkip=("Dir1/" "Dir2/")
    # Scale images that have a lower resolution than that of the screen (yes or no)
    scaleLowerRes="yes"
    #scaleLowerRes="no"
    # Screen resolution
    resWidth=1280
    resHeight=800
    # Command for tiling the wallpaper
    cmdTile="feh --bg-tile"
    #cmdTile="nitrogen --set-tiled --save"OA
    #cmdTile="xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-style -s 2 && xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-path -s"
    #cmdTile="gconftool-2 -t str --set /desktop/gnome/background/picture_options "wallpaper" -t str --set /desktop/gnome/background/picture_filename"
    # Command for scaling the wallpaper
    cmdScale="feh --bg-scale"
    #cmdScale="nitrogen --set-scaled --save"
    #cmdScale="xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-style -s 3 && xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-path -s"
    #cmdScale="gconftool-2 -t str --set /desktop/gnome/background/picture_options "zoom" -t str --set /desktop/gnome/background/picture_filename"
    # Command for centering the wallpaper
    cmdCenter="feh --bg-center"
    #cmdCenter="nitrogen --set-centered --save"
    #cmdCenter="xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-style -s 1 && xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-path -s"
    #cmdCenter="gconftool-2 -t str --set /desktop/gnome/background/picture_options "centered" -t str --set /desktop/gnome/background/picture_filename"
    # End of configuration
    setTiled ()
    `$cmdTile "$1"`
    if [ "$?" = "0" ]; then
    echo "Wallpaper tiled."
    else
    echo "Wallpaper not set!"
    exit 1
    fi
    setScaled ()
    `$cmdScale "$1"`
    if [ "$?" = "0" ]; then
    echo "Wallpaper scaled."
    else
    echo "Wallpaper not set!"
    exit 1
    fi
    setCentered ()
    `$cmdCenter "$1"`
    if [ "$?" = "0" ]; then
    echo "Wallpaper centered."
    else
    echo "Wallpaper not set!"
    exit 1
    fi
    createList ()
    # Go to the wallpaper directory
    cd "$wpDir"
    # Load the list of pictures to a variable
    wpDirList=`(find . -regex ".*\([jJ][pP][gG]\|[jJ][pP][eE][gG]\|[gG][iI][fF]\|[pP][nN][gG]\|[bB][mM][pP]\)$" -type f)`
    # Save the list to disk
    if [[ ( -w "$wpList" ) ]]; then
    echo -n "$wpDirList" > "$wpList"
    # Filter out unwanted folders
    if [[ "$dontSkip" == "false" ]]; then
    for dir in "${wpSkip[@]}"
    do
    grep -Ev "$dir" "$wpList" > ~/.wallpapers-tmpr; mv ~/.wallpapers-tmpr "$wpList"
    done
    fi
    # Output result
    echo "Wallpaper list saved."
    else
    echo "Can't write wallpaper list, aborting!"
    exit 1
    fi
    getImage ()
    # Count number of pictures in the wallpaper list by counting number of lines.
    # Check if the wallpaper list exists, is not empty and we have read persmission on it
    if [[ ( -s "$wpList" && -f "$wpList" ) && -r "$wpList" ]]
    then
    wpListNumber=$(wc -l < "$wpList")
    else
    echo "Can't read wallpaper list, aborting!";
    exit 1
    fi
    # Counter for bad entries in wallpaper list
    badMax=100
    while true; do
    # Get a seed for the random number generator from /dev/urandom
    SEED=$(head -1 /dev/urandom | od -N 1 | awk '{ print $2 }')
    RANDOM=$SEED
    # Find a random line number in the wallpaper list
    # Random number from 1..n.
    #r=$((RANDOM % $wpListNumber + 1))
    r=$(echo $RANDOM%"$wpListNumber"+1 | bc)
    # Print what the line number is
    # Print the r'th line.
    imgPath=`sed -n "$r{p;q;}" "$wpList"`
    # #./ crops that substring but it doesn't matter if it left there
    wpPath="${wpDir}${imgPath#./}"
    # Check if the chosen file exists
    if [ -f "$wpPath" ]; then
    break
    else
    echo -e ""$wpPath": doesn't exist!\n"
    badMax=$(( $badMax - 1 ))
    if [ "$badMax" == "0" ]; then
    echo "Too many non-valid entries found in wallpaper list, aborting!"
    exit 1
    else echo "Choosing new image..."
    fi
    continue
    fi
    done
    # Calculate size and aspect for chosen image and print out information
    imgHeight=$(identify -format "%h" "$wpPath")
    imgWidth=$(identify -format "%w" "$wpPath")
    imgAspect=$(echo "scale=1; "$imgWidth"/"$imgHeight"" | bc)
    echo -e "Image: "$wpPath"\n"
    echo -e "Resolution: "$imgWidth"x"$imgHeight""
    echo -e "Aspect: "$imgAspect":1\n"
    setWallpaper ()
    # Calculate resolution aspect ratio
    resAspect=$(echo "scale=1; "$resWidth"/"$resHeight"" | bc)
    # If the image is smaller than the resolution and is not a tile then scale it, otherwise look at aspect
    if [[ ("$scaleLowerRes" == "yes") && ( "$imgAspect" != "1.0" && ("$imgWidth" -lt "$resWidth" || "$imgHeight" -lt "$resHeight") ) ]]
    then
    setScaled "$wpPath"
    else
    case $imgAspect in
    1.0)
    setTiled "$wpPath"
    1.5 | 1.6 | 1.7 | 1.8)
    if [[ "$resAspect" < "1.5" ]]; then
    setCentered "$wpPath"
    else
    setScaled "$wpPath"
    fi
    if [[ "$resAspect" < "1.5" ]]; then
    setScaled "$wpPath"
    else
    setCentered "$wpPath"
    fi
    esac
    fi
    checkConfig ()
    # Initial errors
    errorsPresent="no"
    dontSkip="false"
    # Check if all variables are set
    if [[ !( ( -n "$wpDir" ) && ( -n "$wpList" ) && ( -n "$resWidth" ) && ( -n "$resHeight" ) && ( -n "$scaleLowerRes" ) && ( -n "$cmdTile" ) && ( -n "$cmdScale" ) && ( -n "$cmdCenter" ) ) ]]
    then
    echo -e "\nOne or more options not set, aborting!"
    exit 1
    fi
    # Check if there is a trailing backslash in the wallpaper directory
    spDir=`echo -n "$wpDir" | tail -c -1`
    if [[ !( "$spDir" == "/" ) ]]
    then
    wpDir=""$wpDir"/"
    fi
    # Check if there is read permission on wallpaper directory and if it is a directory
    if [[ !( ( -r "$wpDir" ) && ( -d "$wpDir" ) ) ]]
    then
    echo "Can't read wallpaper directory!"
    errorsPresent="yes"
    fi
    # Check if the specified wallpaper list is a regular file and not a directory
    touch "$wpList" &> /dev/null
    if [[ ( -d "$wpList" ) ]]
    then
    echo "Specified wallpaper list is a directory, not a file!"
    errorsPresent="yes"
    fi
    # Check if variables are set correctly
    if [[ !( "$scaleLowerRes" == "yes" || "$scaleLowerRes" == "no" ) ]]
    then
    echo "Specified option for scaling the wallpaper is not valid!"
    errorsPresent="yes"
    fi
    if $(echo ""$resWidth"" | grep [^0-9] &>/dev/null)
    then
    echo "Specified resolution width is not a number!"
    errorsPresent="yes"
    fi
    if $(echo ""$resHeight"" | grep [^0-9] &>/dev/null)
    then
    echo "Specified resolution height is not a number!"
    errorsPresent="yes"
    fi
    # Check if any of the tests failed
    if [[ "$errorsPresent" == "yes" ]]
    then
    echo -e "\nOne or more errors found, aborting!"
    exit 1
    fi
    ignoreWPSkip()
    dontSkip="true"
    printUsage ()
    echo -e "Invalid command line argument(s)!\nUsage:\n"
    echo -e "`basename "$0"` [options]\n"
    echo -e "Options:\n"
    echo -e "-s | --set \tSet a wallpaper without updating the list"
    echo -e "-u | --update \tUpdate the list without setting a wallpaper"
    echo -e "-ua | --update-all\tUpdate the list without setting a wallpaper, but don't skip any folders"
    echo -e "-su | --set-update\tUpdate the list and set a wallpaper"
    exit 1
    if [ "$#" == "1" ]; then
    case "$1" in
    "-s" | "--set")
    checkConfig
    getImage
    setWallpaper
    exit 0
    "-u" | "--update")
    checkConfig
    createList
    exit 0
    "-ua" | "--update-all")
    checkConfig
    ignoreWPSkip
    createList
    exit 0
    "-su" | "--set-update")
    checkConfig
    createList
    getImage
    setWallpaper
    exit 0
    printUsage
    exit 1
    esac
    else
    printUsage
    exit 1
    fi
    Last edited by moljac024 (2009-09-14 21:02:13)

    I did something similar a couple of months ago, but instead of attempting to be clever and guessing what the background image is supposed to be, I just write it in the filename. Since some pictures just end up being too bright (or whatever) when used as a background to a urxvt terminal, I added some extra parameters for setting gamma, brightness, tint and the direction the image should be rendered. It relies on hsetroot for actually rendering the picture.
    #!/usr/bin/python
    # set-background
    import sys, os, string, re
    patterns = [ (re.compile("t-([a-f\d]+)"), lambda x: "-tint \#" + x)
    , (re.compile("b-([\d]+)"), lambda x: "-brightness -0." + x)
    , (re.compile("g-([\d]+)"), lambda x: "-gamma "+ x)
    , (re.compile("f-(v|h|d)"), lambda x: "-flip" + x)
    def buildCommand(file):
    output = ["hsetroot"]
    output.append("-" + (string.split(file,".")[-2]))
    output.append(file)
    for token in string.split(file,".")[1:-2]:
    for (pat,f) in patterns:
    if pat.match(token):
    output.append( f(pat.findall(token)[0]))
    return string.join(output)
    print buildCommand(img)
    os.system(buildCommand(img))
    # vim:set et:
    So for instance, an image with the name background.t-704214.f-v.full.jpg would be rendered as a stretched image, flipped vertically with a sepia tint. The files are required to be in the following format NAME.(MODIFIER.)*TYPE.SUFFIX, where the the order and number of modifiers are unimportant. The gamma values are somewhat unintuitive, but I guess you'll just have to play around with it to get it right.
    And to randomize the whole thing, I just used the following script in my .xinitrc to randomly pick a image from a folder.
    #!/bin/bash
    bg_folder="$HOME/.backgrounds";
    pics=($(ls $bg_folder))
    let "n = $RANDOM % ${#pics[@]}"
    (cd $bg_folder; set-background ${pics[$n]})

  • Simple UCCX script for IVR,Welcome message then press 1 and press 2

    Dear Experts;
    I have uccx 10.5.
    I want to write a simple IVR script as below.
    Step-1- Welcome message.with press 1 for Sales and Press 2 for Marketing
    step-2   User Press 1 then transfer the call to Sales Skill Group.
    Step-3  User press 2 then transfer the call to  Marketing Skill group.
    My doubt is how to accept when user press 1 and match the value and then transfer the call to that skill group.
    Really appreciate any link or script for this.
    Regards
    Debashis

    Dear Martyn;
    Thanks a lot that was very nice and valuable information.
    just want to ask which palette i have to use to save the value 1 or 2 when user press 1 or 2.
    I know using Menu we can create different Menu option.
    After user press 1 it will go SALES skill group and if press 2 Go MARKETING Skill group.
    Appreciate if you can help me in this regard.
    Regards
    Debashis

  • Import statement not found for javax.mail.Message

    when i'm in webSphere shich is using jdk1.4.2,
    import javax.mail.Message;
    import javax.mail.MessagingException;
    import javax.mail.Session;
    import javax.mail.internet.AddressException;
    import javax.mail.internet.InternetAddress;
    cannot be found
    Where would the Mail classes be located?
    Thank you

    mail.jar and activation.jar, which can be downloaded here:
    http://java.sun.com/products/javamail/downloads/index.html
    http://java.sun.com/products/javabeans/jaf/downloads/index.html

  • SHA1 digest error for javax/mail/Message.class

    it's been 4 hrs that i am striving to get around this .....Does any body has any idea why this error appears and how to remedy it ....
    help will be much much appreciated....

    Either:
    1. Your mail.jar is corrupted, or
    2. You have more than one copy of the javax.mail.Message class in your CLASSPATH.

Maybe you are looking for

  • Multiple Albums with same content on iPod

    I just downloaded a ton of new music, from a differnt site than iTunes. When I sync the new music to my iPod nano (4 gen.), one artist in particular has some trouble. I go to them and there are 4 or 5 of the same album that say 1 song, 2 songs, 3 son

  • How to change or rename the logical system name T90CLNT090 IN BI 7

    HI Expert's, i am really digging for the solution of changing or renaming the logical system name technical name T90CLNT090. in our company we are using ecc5.0 with bi 3.5 and ecc6 with bi 7. In BW 3.5 having a connection with R/3 and the technical n

  • Free Suggestion for Apple

    It sure would be nice if Apple offered an option such as this. I found this excellent illustration on a Facebook page. Credit to Byron M. Please click on the graphic to read the important details. If you agree please send Apple a feature request at:

  • Returnable packaging accounts

    Hello together, I have a short question regarding returnable packaging accounts: We created an account (ACC1) for Customer A and RP 1 which is valid from 01.08.2007 to 31.12.9999. After a few days, someone else created an account (ACC2) for the same

  • IDM 11g installation

    I am doing 11g installation of IDM and I encounter the error that OID is not up and running. To start this /oracle/oid/bea_default/Oracle_IDM1/opmn/bin ./opmnctl startall The OID connection seems to be alive, But still OIM installation is failing at