Script for setting priority - PID unknown ???

Hi,
On this G4 Mac Classic runs unbearably slow under Mac OS 10.4.5. This is a problem many have (click here for link). Only my kids use Classic and they have their own managed account. Classic auto-launches when they log in.
What I want to do is have a script run for my kids' account. This script should run after Classic is started and set the priority to -20. I know the terminal command is this: "renice PID -20" The problem is that I do not know how to get the PID for "TrueBlueEnvironme" (the process name for Classic). I cannot seem to get "renice" to work with the process name.
So, my two questions:
1) What would the text of a script be which performs the "renice" command on a the process TrueBlueEnvironme when TrueBlueEnvironme has a different PID with each login?
2) How should I set up this script (auto-launch at login or tell it to pause?) so that it automatically runs after Classic launches?
Thanks much,
Mace

Hi Mace,
   Here's a function that waits five minutes until a single process is found that matches its argument. Thus, if you invoke the function, "psnice TrueBlue", it will renice TrueBlueEnvironment if a single PID is found within five minutes of the function being invoked. By the way, this function minimizes the priority of TrueBlueEnvironment as was suggested in the thread to which you linked. This is different from your question here, which was to maximize the priority of TrueBlueEnvironment.
function psnice
    INDEX=0
    until [ $INDEX -gt 100 ]; do
        PID=$( ps -axwwo pid,command | awk '/'$1'/{ if ( $0 !~ /grep|awk/ ){ print $1 }}' )
        PID_COUNT=$( echo $PID | wc -w )
        if [ $PID_COUNT -eq 1 ]; then
            renice 20 -p $PID
            break
        elif [ $PID_COUNT -gt 1 ]; then
            echo "Too many processes found."
        fi
        sleep 3
        let INDEX++
    done
}By the way, don't copy the above code using copy-and-paste because indention is produced with non-breaking spaces. Scripts won't like those. You would have to replace leading spaces with the "regular" kind.
Gary
~~~~
   Always do right. This will gratify some people and astonish
   the rest.
         -- Mark Twain

Similar Messages

  • UCCX 8.5.1 Scripting Assistance - Set Priority

    Hello,
    I am trying to configure the priority in my script similar to how they did this in the below discussion. 
    https://supportforums.cisco.com/discussion/11892936/uccx-851-basic-scripting-assistance-set-priority
    When I put the "set priority" in the script it errors out and callers hear the message that the system is experiencing problems.  The script runs fine without the "set priority".  Any assistance would be greatly appreciated.

    Chris,
    I attempted to validate the script and did get an error with the "Set Enterprise Call Info" step.  What's odd is that without the priority step the script still does not validate, but actually works fine.  As soon as I add the priority step to it though it breaks.
    I removed the "Set Enterprise Call Info" step and the priority works as expected now.  Thank you for your assistance.
    Jared

  • 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);

  • 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]})

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

  • PowerShell Script for Setting the Welcome Page View of a document set

    Hi,
    We are using document set in the document library and we have created the separate view in the document set and it will show only particular metadata columns. We need to change from default view to another view. For this, we need to write the power shell
    script and update the document set welcome page view link in the document set template. Please let me know how we can get this.
    Thanks,
    Mylsamy

    Hey Mylsamy,
    welcome page view is stored in $contenttype.XmlDocuments. Here is how you can change the view using powershell:
    $web = Get-SPWeb "WEBURL"
    $list = $web.Lists["LISTNAME"]
    $contenttype = $list.ContentTypes["CONTENTYPENAME"]
    $viewid = $list.Views["VIEWNAME"].Id
    $xmldocs = $contenttype.XmlDocuments
    foreach($xmldoc in $xmldocs)
    if($xmldoc.Contains("WelcomePageView"))
    Write-Host "XML contains WPV"
    $newview = [XML] @"
    <wpv:WelcomePageView xmlns:wpv="http://schemas.microsoft.com/office/documentsets/welcomepageview" ViewId="$viewid" />
    $xmldocs.Delete("http://schemas.microsoft.com/office/documentsets/welcomepageview")
    $xmldocs.Add($newview)
    break;
    $contenttype.Update($updateChildren, $false)
    Write-Host "Welcome Page View updated at " $list.Title
    Regards,
    Alexander 

  • 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

  • Script for setting Imported Excel Table Cell Inset

    InDesign CS3 Windows XP
    I've checked the FAQ and ran all the searches, but I can't find this. My old computer crashed and took with it a script that I had that would set all the cell insets for the cells of the imported Excel tables in one swelled foop. Can someone point me to the source again? My price sheets are nothing but imported Excel tables and it takes forever to set all the insets for each block separately.
    Thanks,
    JAG

    Phah.
    app.documents.everyItem().stories.everyItem().tables.everyItem().cells.everyItem().propert ies = [topInset:"1cm"]; //??
    This one-liner may need some additional work, but when I am done with it, it'll set the insets for all tables in every open document.
    Perhaps 'everyItem' also works on disk files ...
    [Edit] Just pulling your leg. I'll take a look on the one-liner when I'm back at work.
    I've got a class in a couple of weeks on Javascripting ...
    I'm jealous. They give classes about this? BTW, JavaScript is not that hard (e.g., not harder than any other reasonably popular programming language), but its interface to InDesign is something else. In this case, the magic word is 'everyItem'. (You'll learn.)

  • Script for setting Inco-terms in Master Agreement Setup

    Hi All,
    We have a requirement to create a follow-on child Master Agreement from a Parent MA. So we are writting a toolbar script to craete this follow-on Master Agreement. The problem we are facing is , we are not able to populate inco-terms (delivery terms) from the setup of Parent to Child Master Agreement.
    Although Master Agreement Setup has APIs but it seems there is no method which can allow us to get and set the values of inco-term in the collection (DEL_TERM_COLLN ) which is present in the setup of Master Agreement.
    Can you please throw some light on this issue, if it would be possible to set incoterms values in Master Agreement Setup.
    Thanks in Advance!
    Regards,

    Hello,
    If the IAPI doesnu2019t have the getter and setter, I would suggest raising a OSS message with SAP.
    Regards,
    Vikram

  • How can I write a script for set left indent?

    In three cases as below:
    for example:
    left indent:8mm; first indent:0mm
    left indent:0mm; first indent:8mm
    left indent:8mm; first indent:-8mm
    How can I write a script to tell Indesign, wherever the text indent is, each time when I run the script once, the text can put just a step rightward, and “one step = 8mm”.
    Please!

    Hi, Trevor
    I use change by list as below:
    grep {leftIndent:48mm} {leftIndent:56mm}
    grep {leftIndent:40mm} {leftIndent:48mm}
    grep {leftIndent:32mm} {leftIndent:40mm}
    grep {leftIndent:24mm} {leftIndent:32mm}
    grep {leftIndent:16mm} {leftIndent:24mm}
    grep {leftIndent:8mm} {leftIndent:16mm}
    grep {firstLineIndent:8mm, leftIndent:48mm} {firstLineIndent:8mm, leftIndent:56mm}
    grep {firstLineIndent:8mm, leftIndent:32mm} {firstLineIndent:8mm, leftIndent:48mm}
    grep {firstLineIndent:8mm, leftIndent:24mm} {firstLineIndent:8mm, leftIndent:32mm}
    grep {firstLineIndent:8mm, leftIndent:16mm} {firstLineIndent:8mm, leftIndent:24mm}
    grep {firstLineIndent:8mm, leftIndent:8mm} {firstLineIndent:8mm, leftIndent:16mm}
    grep {firstLineIndent:-8mm, leftIndent:48mm} {firstLineIndent:-8mm, leftIndent:56mm}
    grep {firstLineIndent:-8mm, leftIndent:32mm} {firstLineIndent:-8mm, leftIndent:48mm}
    grep {firstLineIndent:-8mm, leftIndent:24mm} {firstLineIndent:-8mm, leftIndent:32mm}
    grep {firstLineIndent:-8mm, leftIndent:16mm} {firstLineIndent:-8mm, leftIndent:24mm}
    grep {firstLineIndent:-8mm, leftIndent:8mm} {firstLineIndent:-8mm, leftIndent:16mm}
    but not that perfect,
    I want to useing jave "if{}" or "for{}" to write this script, but I don't kown the syntext.

  • E2000 setting priority is not working for one PC

    my home has a max download speed of 300 KB/s. which can make gaming quite an issue if someone in the house starts using something that is a bit of a drain on the bandwidth.
    i fixed the issue for a few months by setting the gaming console to be the only device with high priority. but for some reason my sisters hp laptop still drains all the bandwidth shen he loads youtube. and the only way to stop it is a mac address block on that computer so the game isnt literally frozen still.
    i need to figure out how to get the priority working against this device.

    In this section, you can set the bandwidth priority for a variety of applications and devices. There are four levels priority: High, Medium, Normal, or Low. When you set priority, do not set all applications to High, because this will defeat the purpose of allocating the available bandwidth. If you want to select below normal bandwidth, select Low. Depending on the application, a few attempts may be needed to set the appropriate bandwidth priority.
    To Enable QoS service on your router you can follow this link and follow the steps on the website: http://www6.nohold.net/Cisco2/ukp.aspx?vw=1&docid=05ef4bac579a47d39d9454a4b0583cbf_1701.xml&pid=80&r...
    Second, let me know the current firmware version in the router management page: http://www6.nohold.net/Cisco2/ukp.aspx?vw=1&docid=df680dece5cd4f7ea8141ea0026db71a_4046.xml&pid=80&r...

  • How do I set pages up so that I can type a script for a radio play

    here we go, that is if I'm not driven mad by the process of trying to work out how to use this help thing.
    how do I set pages up so that I can type a script for a radio play ie the character then as an indented bit what they say

    Here's a sample, using what should be a familiar script to any radio drama buff, and showing a few of the features you'll want to incorporate into your template.
    Features noted by arrows:
    This is the "First line indent" margin stop, in this case, set to produce a 'hanging indent'. This stop sets the starting position of the first line of a Paragraph.
    Left margin stop: This stop sets the starting position of all lines in a paragraph except the first.
    When setting margins, set this one first, as it will drag the First line indent stop with it when moved. After setting this one (by dragging it to the position on the ruler where you want it to be), drag the rectangle (First line stop) left as far as it will go.
    Right margin stop.
    Running Header: This is a combination of text that appears on every page, plus the page number / page count—very useful information when someone drops his script. (Typed here, but a combination of typing and inserting the two number calculators from the Insert menu in the actual template.)
    Tab character. Used to move the first line of the dialogue into alignment with the rest of that paragraph. The Left margin stop also acts as a Tab stop.
    Paragraph break (made by pressing the return key). After a Paragraph break, the next line of the script will start at the left margin of the page. To break a long monologue into smaller blocks, use a 'soft return', made by pressing Shift-return, as I've done twice here...
    ...to produce an empty line without creating a 'new paragraph' (or in this case, a new item on the current list.
    Those are the basics for producing the body of your script.
    Regards,
    Barry
    Sample script is an excerpt from:
    The War of the Worlds
    COLUMBIA BROADCASTING SYSTEM
    ORSON WELLES AND MERCURY THEATRE ON THE AIR
    SUNDAY, OCTOBER 30, 1938
    8:00 TO 9:00 P.M.

  • How Can I write Script for Indesign set left indent

    I really need two scripts for indesign set left indent:
    1. If the left indent is: 8, 16, 24, 32, 40, 48, 56mm... set the first -8mm; if the left indent is 0, set the left indent 8mm, first -8mm.
    2. Whatever the first indent is, set the first 8mm.
    Can someone help me?

    Hi, Trevor
    I use change by list as below:
    grep {leftIndent:48mm} {leftIndent:56mm}
    grep {leftIndent:40mm} {leftIndent:48mm}
    grep {leftIndent:32mm} {leftIndent:40mm}
    grep {leftIndent:24mm} {leftIndent:32mm}
    grep {leftIndent:16mm} {leftIndent:24mm}
    grep {leftIndent:8mm} {leftIndent:16mm}
    grep {firstLineIndent:8mm, leftIndent:48mm} {firstLineIndent:8mm, leftIndent:56mm}
    grep {firstLineIndent:8mm, leftIndent:32mm} {firstLineIndent:8mm, leftIndent:48mm}
    grep {firstLineIndent:8mm, leftIndent:24mm} {firstLineIndent:8mm, leftIndent:32mm}
    grep {firstLineIndent:8mm, leftIndent:16mm} {firstLineIndent:8mm, leftIndent:24mm}
    grep {firstLineIndent:8mm, leftIndent:8mm} {firstLineIndent:8mm, leftIndent:16mm}
    grep {firstLineIndent:-8mm, leftIndent:48mm} {firstLineIndent:-8mm, leftIndent:56mm}
    grep {firstLineIndent:-8mm, leftIndent:32mm} {firstLineIndent:-8mm, leftIndent:48mm}
    grep {firstLineIndent:-8mm, leftIndent:24mm} {firstLineIndent:-8mm, leftIndent:32mm}
    grep {firstLineIndent:-8mm, leftIndent:16mm} {firstLineIndent:-8mm, leftIndent:24mm}
    grep {firstLineIndent:-8mm, leftIndent:8mm} {firstLineIndent:-8mm, leftIndent:16mm}
    but not that perfect,
    I want to useing jave "if{}" or "for{}" to write this script, but I don't kown the syntext.

  • Hello, I received a message to set my icloud and the screen went blank, the computer will reboot and now asks me for a PIN code unknown to me, what should I do?

    Hello, I received a message to set my icloud and the screen went blank, the computer will reboot and now asks me for a PIN code unknown to me, what should I do?

    It has been remotely locked by the owner, or by someone who knows the owner's Apple ID and password.

Maybe you are looking for

  • Install using SDTV as monitor?

    I'm wanting to install Arch on another machine, but only have a SDTV as a monitor. While I can verify that the machine and TV connection works fine, I don't get anything but a black screen when I try and boot from the Arch CD. Am I right in thinking

  • Dual display help for a recently converted mac user

    I have a 24" Intel IMac and I wanted to set up dual displays. I may have jumped the gun a little because I didn't do much homework but I found a big cheap monitor at Best Buy which is an HP w2338. I bought that and the mini-DVI to VGA adapter. I hook

  • IPhone restore problem.

    Dear friends, Yesterday night I made Back up of my iphone 4S. Today When I tried to restore the back up, it restored only (contacts) and (my email account). It did not restored any programs that I installed on my iphone. There wrere many programs tha

  • Why I cannot export Video from my Premiere CS6 to my DVC PRO AJ-D455?

    I am trying to export video from my Premiere CS6 to my DVC PRO AJ-D455 I can only capture the video but not export, why?

  • How  do i connect 2 monitors to intel mac pro 2009 model

    im currently using my mac for my recording studio and i really want to connect a second screen, can the intel macs 2009 handle a second screen? there doesnt seem to be a second connection on the back of the tower to connect another screen.i have very