Applescript help with true or false script

I'm in need of a applescript that will run two different scripts based on the outcome of an existing file.
I have a folder called Status. Inside this folder is a simple text file called Good.rtf
I would like a script that would run one or the other script base on the true or false output.  If file exists then:
true will
run script A
false will
run script B
I have been searching the web for two days looking for something to help me get started on this and have not had much success.
Please help me.   I really would appropriate any help or guidance. 
Thanks....
Ron

Ron
AppleScript calls this kind of script a "Conditional" = if this > then that
Some templates are in MacintoshHD/Library/Scripts/Script Editor Scripts/Conditionals
You don't need a value for "false" in binary as it is merely "not true" (else)
if true then
    -- insert if actions here
else
    -- insert else actions here
end if
If you already have your Scripts A & B working, copy>pastethem into the "insert actions here" part as appropriate
ÇÇÇ

Similar Messages

  • [SOLVED] Need a little help with ACPI handler.sh script.

    By using ACPI I'm trying to get my laptop to hibernate at critical power state. So far I've made a few test scripts to test how to do this, with one of these scripts I'm stuck. My scripting skills are not that good to solve it.
    This is the script:
    if [ `awk '{print $3}' /proc/acpi/battery/C1E9/state` == "ok" ]
    then
    logger "battery is ok"
    else
    logger "battery is not ok"
    fi
    If I run the script I get an error (while "battery is not ok" is logged):
    ┌─[~]
    └─> ./test2
    ./test2: line 1: [: too many arguments
    ┌─[~]
    └─>
    When I run the awk-command from the script, I get the following output:
    ┌─[~]
    └─> awk '{print $3}' /proc/acpi/battery/C1E9/state
    ok
    discharging
    2341
    1824
    10969
    ┌─[~]
    └─>
    I think the problem lies in the multiple output of the awk-command, but I'm stuck in solving it.
    Any help would be great.
    Last edited by NeoXP (2009-11-16 22:40:45)

    @ skanky
    Thanks for the suggestion, but you're right I'm not gonna change a working script. It is working exactly as expected.
    @ all
    When interested this is my current handler.sh
    #!/bin/sh
    # Default acpi script that takes an entry for all actions
    # NOTE: This is a 2.6-centric script. If you use 2.4.x, you'll have to
    # modify it to not use /sys
    minspeed=`cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq`
    maxspeed=`cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq`
    setspeed="/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed"
    set $*
    case "$1" in
    button/power)
    echo "PowerButton pressed!">/dev/tty5
    case "$2" in
    PWRF) logger "PowerButton pressed: $2" ;;
    *) logger "ACPI action undefined: $2" ;;
    esac
    button/sleep)
    case "$2" in
    SLPB) echo -n mem >/sys/power/state ;;
    *) logger "ACPI action undefined: $2" ;;
    esac
    ac_adapter)
    case "$2" in
    AC)
    case "$4" in
    00000000)
    echo -n $minspeed >$setspeed
    #/etc/laptop-mode/laptop-mode start
    00000001)
    echo -n $maxspeed >$setspeed
    #/etc/laptop-mode/laptop-mode stop
    esac
    *) logger "ACPI action undefined: $2" ;;
    esac
    battery)
    if [ `awk '{print $2}' /proc/acpi/ac_adapter/C1E8/state` == "off-line" ];
    then
    logger "battery discharging"
    if (( `awk '{if (NR==5) {print $3}}' /proc/acpi/battery/C1E9/state` >= "250" ))
    then
    logger "battery ok"
    else
    logger "battery not ok"
    /usr/sbin/pm-hibernate;
    fi
    else logger "battery charging"
    fi
    button/lid)
    if [ `awk '{print $2}' /proc/acpi/button/lid/C1ED/state` == "closed" ];
    then
    logger "ACPI lid closed"
    /usr/sbin/pm-suspend
    fi
    logger "ACPI group/action undefined: $1 / $2"
    esac
    Still working on it though

  • Help with a date field script

    Sorry if this is a repeat. I was interrupted and found that my browser had crashed when I came back so I'm not sure if the question got asked.
    I need a script for a date field (mm/dd/yyyy) where the user can only fill in a date that is between 12/31/1899 and the current date (whatever the date when the form is opened). I'm getting better at writing these but I haven't been successful with this one. Any help would be greatly appreciated.
    Thanks!

    I have a feeling I already answered this question some time ago... Anyway, you can use this code as the field's custom validation script:
    var minDate = util.scand("mm/dd/yyyy", "12/31/1899");
    var maxDate = new Date();
    event.rc = true;
    if (event.value) {
        var d = util.scand("mm/dd/yyyy", event.value);
        if (d<minDate || d>maxDate) {
            app.alert("Error! The entered date must be between " + util.printd("mm/dd/yyyy", minDate) + " and " + util.printd("mm/dd/yyyy", maxDate));
            event.rc = false;

  • New bee looking for applescript help with text edit app

    I have a huge text files (20+) , I want to find a list of words like weather, farmers, ploughing. I want to find these words one at a time, as my text file is 250+ Mb in size.
    I want applescript to count the how many times each word appears in the text.
    Paste that occurrence of word into an spreadsheet file in a row named after text file , and in a column named weather, farmers, ploughing.
    Please help.
    Thanks much.
    CF
    PS so far I can open the text files with applescript, that is about the extent of my ability in programing.
    Message was edited by: coldfusions onco

    For a file of that size, you would need to use some shell utilities to get decent performance. To count words, the following script breaks up the text into words, then counts the number of times the specified word is found (a dictionary file is used as an example, so the match is equivalent to 'contains'):
    <pre style="
    font-family: Monaco, 'Courier New', Courier, monospace;
    font-size: 10px;
    font-weight: normal;
    margin: 0px;
    padding: 5px;
    border: 1px solid #000000;
    width: 720px;
    color: #000000;
    background-color: #DAFFB6;
    overflow: auto;"
    title="this text can be pasted into the Script Editor">
    set theFile to "/usr/share/dict/web2" -- a 2.5MB list of words
    set someWords to {¬
    {theWord:"weather", theCount:0}, ¬
    {theWord:"farmers", theCount:0}, ¬
    {theWord:"ploughing", theCount:0}}
    repeat with anItem in someWords
    set aWord to quoted form of theWord of anItem
    try -- break up into individual words, then search and count
    set theCount of anItem to (do shell script "tr -cs '[:alpha:]' " & quoted form of linefeed & " < " & theFile & " | grep -ic " & aWord) as integer
    end try
    end repeat
    someWords
    </pre>
    Is this related to your Automator post?

  • Help with selecting files from script menu or drag and drop

    I found this scale images applescript online. It works great when a bunch of files is dragged on top of the script but I would like it to also work when a folder or group of files is selected in the Finder and I activate it from the scripts menu.
    I can't get my on run statement to work. I'm not really an Applescript guy so I'm really just asking if someone can help finish what I started in this on run.
    -- save in Script Editor as Application
    -- drag files to its icon in Finder
    property target_width : 120
    property save_folder : ""
    on run
    tell application "Finder"
    activate
    set folder_path to quoted form of (POSIX path of (the selection as alias))
    set theItems to every file of folder_path
    end tell
    end run
    on open some_items
    -- do some set up
    tell application "Finder"
    -- get the target width, the default answer is the property target_width
    set new_width to text returned of ¬
    (display dialog "Target width:" default answer target_width ¬
    buttons {"OK"} default button "OK")
    if new_width as integer > 0 then
    set target_width to new_width
    end if
    -- if the save_folder property has not been set,
    -- set it to the folder containing the original image
    if save_folder is "" then
    set save_folder to ¬
    (container of file (item 1 of some_items) as string)
    end if
    -- get the folder to save the scaled images in,
    -- default folder is the property save_folder
    set temp_folder to ¬
    choose folder with prompt ¬
    "Save scaled images in:" default location alias save_folder
    set save_folder to temp_folder as string
    end tell
    -- loop through the images, scale them and save them
    repeat with this_item in some_items
    try
    rescaleand_save(thisitem)
    end try
    end repeat
    tell application "Image Events" to quit
    end open
    on rescaleand_save(thisitem)
    tell application "Finder"
    set new_item to save_folder & "scaled." & (name of this_item)
    end tell
    tell application "Image Events"
    launch
    -- open the image file
    set this_image to open this_item
    set typ to this_image's file type
    copy dimensions of this_image to {current_width, current_height}
    scale this_image by factor (target_width / current_width)
    save this_image in new_item as typ
    end tell
    end rescaleandsave

    When items are dragged to your script's icon they are passed in to the on open handler, so this triggers:
    on open some_items
    and the dragged items are passed in as some_items
    In contrast, when you double-click on the script, or invoke it via the Script menu, this runs the on run handler:
    on run
      tell application "Finder"
        activate
        folder_path to quoted form of (POSIX path of (the selection as alias))
        set theItems to every file of folder_path
      end tell
    end run
    However, there's nothing in this block that actually does anything with the selection - you (dangerously) assume that the selection is a folder (you really should check first), and just set theItems to every file in that folder then you exit.
    So to do what you want you'll need to edit your run handler to filter the selection and pass files over to the code that does the hard work.
    You already have the basis for this - your rescaleandsave() handler, so it's just a matter of identifying the files in the selection and passing those over to that handler:
    on run
      tell application "Finder"
        set cur_selection to (get selection) -- get the selection
        repeat with each_item in cur_selection -- iterate through
          if class of each_item is folder then -- do we have a folder?
            set theFiles to every file of each_item -- if so, get its contents
            repeat with each_file in theFiles -- iterate through them
              my rescaleand_save(eachfile) -- and process them
            end repeat
          else if class of each_item is document file then -- do we have a file selected?
            my rescaleand_save(eachitem) -- if so, process it
          end if
        end repeat
      end tell
    end run
    So the idea here is that the run handler gets the selection and works through the (potentially-numerous) items. For each selected item it checks whether its a folder or a file, if its a folder it gets all the files within and passes them to the rescaleandsave handler.
    Note that this is not recursive - it won't catch files within folders within folders - since it only looks at the top level of selected folders, but it wouldn't be hard to rework the script to handle that if that's what you need.

  • Help with a program Option Script

    I need some help writing a Option Frame for a Add-in on my program. The basic thing it will do is to call a KeyListener with a KeyAdapter, wait for a key to be pressed, assign the key that was pressed to an int (i.e. LEFT for e.VK_LEFT) and send it to my main program. I don't have the script completely written yet, but I'm not sure how I can send 7 int values to my main program at the same time. I was thinking of something like:
    LEFT = KA_Options.getIntLEFT(int temp_LEFT);but if their is an easier way to get all the int's called at once instead of calling 7 different classes everytime a key is pressed in my main program (because of Beta testing, I don't exactly want to assign them to their own int values intill I get the code almost bug free). I would like to put my main program in this thread, but the hugeness of it, it would make reading the posts hard.
    Thanks,
    g@m3r

    This is the basic working code for my KA_Options script
         KA Option Pop-up
         Version 0.1b
    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    public class KA_Options extends Frame implements ActionListener
         String title= "KA Options 0.1b";
         int LEFT, RIGHT, UP, DOWN, A, S, D; //The Directional Ints
         MenuBar kamenu = new MenuBar();
         Menu file = new Menu("File");
              MenuItem file_close = new MenuItem("Close");
         Menu options = new Menu("Options");
              MenuItem options_default = new MenuItem("Default Controls");
         public static void main(String[] args)
              KA_Options window = new KA_Options();
         public KA_Options()
              setTitle(title);
              setSize(100,100);
              setResizable(false);
              setLocation(0,200);
              KAMenuSetup_v1b();
                   setMenuBar(kamenu);
              addWindowListener(new WindowAdapter()
                   { public void windowClosing(WindowEvent e)
                        { setVisible(false); }
              pack();
         public void KAMenuSetup_v1b() //Beta
              kamenu.add(file);
                   file.add(file_close);
                        file_close.setActionCommand("Close");
                        file_close.addActionListener(this);
              kamenu.add(options);
                   options.add(options_default);
                        //options_default.setActionCommand("Default");
                        //options_default.addActionListener(this);
         public int getIntLEFT()
              return LEFT;
         public int getIntRIGHT()
              return RIGHT;
         public int getIntUP()
              return UP;
         public int getIntDOWN()
              return DOWN;
         public int getIntA()
              return A;
         public int getIntS()
              return S;
         public int getIntD()
              return D;
         public void actionPerformed(ActionEvent e)
              String arg = e.getActionCommand();
              if(arg == "Close")
                   { setVisible(false); }
    } I'm still writing the bulk of the code.

  • Help with automatic unmounting via script

    Sorry, for some reason, this question got posted twice.
    I would like to reroute you to this thread: http://discussions.apple.com/thread.jspa?threadID=1610643&tstart=0
    Could some kind soul please help me a bit with some applescript?
    I would need two things in applescript:
    1. A way to check whether a certain external (firewire) disk is mounted
    (so that I can unount, er, eject it, if it is there)
    2. A way to make an applescript being executed whenever the laptop goes to sleep.
    For the interested reader:
    what I want to do is to write an applescript that would automatically unmount my external backup disk whenever the laptop goes to sleep.
    Oftentimes I forget to do that myself, then, when the computer is asleep and I want to unplug everything to take it home, I remember that I haven't properly ejected the backup disk ...
    Any hints, pointers, tips will be appreciated!
    Best regards,
    Gabriel.
    Message was edited by: GabrielZ

    TeHDoHBoY wrote:
    *sudo rm -rf ~/Library/Caches*
    *sudo ln -s /private/tmp ~/Library/Caches*
    If you have a script using "sudo", it will always prompt for a password. The easy way to call this is put your script in /Library/Resources/Scripts/ (you'll have to create the Resources/Scripts/ path) and follow these steps.
    Step 1.) Edit your script and take out the "sudo" commands, leaving the following:
    rm -rf ~/Library/Caches*
    ln -s /private/tmp ~/Library/Caches*
    Step 2.) Then open up Terminal and execute the following commands:
    chown root:wheel /Library/Resources/Scripts/NameOfYourScript.sh
    chmod 755 /Library/Resources/Scripts/NameOfYourScript.sh
    Now create your login hook to call this script. If I'm correct, the script will run as root and not prompt the student for a password.

  • Help with EEM TCL / CLI scripting for re-direction/wccp counters

    Being new with EEM scripting I wanted to see if I was on the right track and get some help to finish my idea.
    Our problem I am trying to fix is our remote sites utilize pairs of Cat3650's for some routing and WCCP redirection.  We are encountering ACL denial issues causing slow down and access issues.  The fix for the issue we remove the WCCP service groups to break peering with our wan optimizers and re-insert the configuration thus re-establishing peering and restoring service.
    My idea is to use a TCL scipt on a watchdog timer to parse the "sh ip wccp | inc denied (or unassign)" output for denial and unassignable error counters.  If a counter is found I wanted to create a syslog message that would then kick off a simple EEM CLI script to remove the service groups, wait 10 seconds, then re-add the service groups.  Please point me in the right direction if I am off track as I am not sure if I can use the EEM CLI for all this or since I want to retreive specific info from the sh ip wccp output if I do need to utilize TCL.  I am also unsure if the "total denied" ascii string pulled via the "sh ip wccp | inc denied" will cause issues when attempting to just pull the counter information.
    sh ip wccp | inc Denied Red
            Total Packets Denied Redirect:       0
            Total Packets Denied Redirect:       0
    Script thus far :
    TCL
    if [catch {context_retrieve "EEM_WCCP_ERROR_COUNTER" "count"} result] {
    set wccpcounter 0
    } else {
    set wccpcounter $result
    } if [catch {cli_open} result] {
    error $result
    } else {
    array set cli $result
    } if [catch {cli_exec $cli(fd) "show ip wccp | incl Denied"} result] {
    error $result
    } else {
    set cmd_output $result
    set count ""
    catch [regexp {receive ([0-9]+),} $cmd_output} ignore count]
    set count
    set diff [expr $count - $wccpcounter]
    if {$diff != 0} {
    action_syslog priority emergencies msg "WCCP counters showing incremental Denied packet counts"
    if [catch {cli_close $cli(fd) $cli(tty_id)} result] {
    error $result
    context_save EEM_WCCP_ERROR_COUNTER count
    CLI
    event manager applet WCCP_COUNTER_WATCH
    event syslog priority emergencies pattern "WCCP counters showing incremental Denied packet counts"
    action 001 cli command "enable"
    action 002 cli command "config t"
    action 003 cli command "no ip wccp 61"
    action 004 cli command "no ip wccp 62"
    action 005 wait 10
    action 006 cli command "ip wccp 61"
    action 007 cli command "ip wccp 62"
    action 008 wait 15
    action 009 cli command "clear ip wccp"
    action 010 cli command "end"
    Thanks for all the help

    This won't work as EEM cannot intercept its own syslog messages.  However, I'm not sure why you need this form of IPC anyway.  Why not just make the Tcl script perform the needed CLI commands?
    And, yes, you could use all applets here.  But since you've written the hard stuff in Tcl already, it might be best just to add the missing calls to reconfigure WCCP to that script.

  • Flash Newbie needs help with Movie Clips/Action Scripting

    Hi -
    I'm having a problem with my movie clips playing
    simultaneously and cannot, for the life of me, figure out what I
    have done wrong. I'm new to flash, so I may have set something up
    incorrectly, but here's what I have so far:
    11 layers, total: 1 layer with 10 control buttons, each
    button with the following actionscript:
    on (release) {
    gotoAndPlay(85);
    Where the number changes in relation to which keyframe the
    next movie is on.
    I have 10 movies, total, but they are only movie clips,
    essentially photo slide shows with audio, made all in the library.
    The problem happens when I click on the second or third
    button. Not only does the movie that I have selected begin to play,
    but all of the previous clips do as well, so it all sounds quite
    garbled. I don't know what I am missing in the action script, as my
    Action Layer has a stop command on it at each keyframe where there
    is a new clip to play.
    I have tried to add a stopAllSounds command, but I'm afraid
    that doesn't do anything because it is not a "sound file" per se,
    playing in the timeline.
    I'm at the end of my rope and really need some help in
    figuring this one out. My project is hanging in the balance on
    this, as I have scripted everything else correctly and it runs
    beautifully.
    Please help!
    Thanks,
    Caroline

    Each layer has a blank keyframe before and after each
    movieclip. Each movie clip is at a different frame. Even with the
    blank keyframes added, the second video starts to play and then the
    first video begins to play. Same happens if I click on the third
    button. Third plays, and starts 1st and 2nd shortly thereafter. Is
    there an action script I can put in that will tell the timeline
    that, when a button is clicked, no matter where the movieclip is,
    it will stop and start the newly selected movieclip?

  • Help with UCCX 8.5 scripting and xmls

    I have a customer with multiple scripts, we are moving them from 3.5 to 8.5 which is running on VMWare.  Here's my scenario:
    The caller can call the trigger 54779, enter a #, then a password of 12345.  Then they can set a normal condition by dialing 1, an after-hours condition by dialing 2, or an emergency condition by dialing 3.  I’m testing the “2” condition now. In the previous 3.5 system, if they dialed 2, the system copied the Doc “2.xml” and copied it to the Doc "Carolina_Access_Emergency_Check.xml", both of which are in the en_US folder in the Documents section.
    I can’t get this thing to change my document "Carolina_Access_Emergency_Check.xml". All I know is that it goes, “unsuccessful”. I’m pretty sure the authentication is working since it gets by that step.  If we can’t get the “copy” to work, really all I need to do with this option 2, is for the data in "Carolina_Access_Emergency_Check.xml" in <TYPE>1</TYPE> to change from a 1 to a 2." I'm attaching a zip with the old and new scripts along with the 2 xml files i'm referring to.  I need help on this one, please!

    Has the user you setup have Application Admin rights? I had this issue when I was trying to create an Emergency shutdown script and the user did not have sufficient rights.
    I don't mind sharing this script I created ,which effectively changes a value from 1 to a 2, which seems to be what you are trying to do but I can not figure out how to share it with you here. You could then use this as example to achieve what you are trying to do.

  • Anyone here can help with a quick bash script?

    I am no coder, by any means, unless you consider html code....I don't
    any how, here's what i'm trying to do, if someone who knows bash would like to assist?
    i have a folder, with a bunch of subfolders, inside these subfolders, is a setup.xml file.
    and inside these setup xml files is a line titled product code with a string after it.
    i could really use a script or sorts to go through and output all those product codes into a single text file right now, otherwise i'm sure i'll be here for hours
    anyone care to help?

    ooooh.......that works
    tweaked it a bit and ran it from the source folder, worked well, this is what i ran though
    find -name \Setup.xml -exec grep 'productcode' '{}' \; > theFile
    does this give you any idea as to the file structure of the xmls?
    <Setups productcode="ICA.productcode">
    <Msi productcode="UpdateX3.exe" file="WPO15\UpdateX3.exe" cmdline="/s" adminsupport="0" condition="UpdateX3=1"/>
    <Msi productcode="{6E274E81-F9E1-43A2-9672-E45F655953FA}" file="WPO15\UpgradesX4.msi" cmdline="ADDLOCAL=ALL" progresstext="Str.UpgradeProgressText" adminsupport="0" condition="REMOVE_14" scheduled="0" ignorereturn="1" />
    <Msi productcode="{DCDAB2ED-5741-4C30-A1A4-0FCB8A529001}" file="ICA_X4.msi" cmdline="REMOVE=ALL" progresstext="Str.UpgradeProgressText" adminsupport="0" condition="REMOVE_14" scheduled="0" ignorereturn="1" />
    <Msi productcode="{92B60B3B-7DF3-4BF7-8823-9F17A9EEA31E}" file="WPO15\Setup.msi" progresstext="Str.ProgressText.Common" cmdline="ICA_ALL_PUBLIC" managed="1">
    <Dbm productcode="{71D2F8EE-9D45-4D95-A6F6-F6433C2B94B5}" file="WPO15\ENSystem.msi" progresstext="Str.ProgressText.Common" adminsupport="0"/>
    <Dbm productcode="{EC61C6D9-159B-4B14-AAF3-AF33FCFA50DD}" file="WPO15\ENWP.msi" cmdline="ADDVIEWERS=[ADDVIEWERS]" progresstext="Str.ProgressText.WP" />
    <Dbm productcode="{DAEDCD3D-B981-4F10-B17B-764753EDAF9F}" file="WPO15\ENQP.msi" progresstext="Str.ProgressText.QP" />
    <Dbm productcode="{378BAC91-3AE8-45F0-90E4-4F81E3EAEBC5}" file="WPO15\ENPR.msi" progresstext="Str.ProgressText.PR" />
    <Dbm productcode="{17C5A285-F7B6-492B-8F3B-343D02B84D75}" file="WPO15\ENCommon.msi" progresstext="Str.ProgressText.Common" cmdline="ESTIMATEDSIZE=[ICA.DiskSpace.Drive.Required.0] PIDPREFIX=WP15" />
    <Dbm productcode="{D7643510-C1AE-44AD-B0F9-0665C4D73BFD}" file="WPO15\LegalTools.msi" progresstext="Str.ProgressText.WP" />
    <Dbm productcode="{CD5C6C29-E6CB-4DF3-B45F-A04087B1C294}" file="WPO15\ENTemplates.msi" progresstext="Str.ProgressText.WP" />
    <Dbm productcode="{E67732DE-3387-4F1E-BDDA-2D0C08BC025B}" file="WPO15\ENFilters.msi" progresstext="Str.ProgressText.Common"/>
    <Dbm productcode="{6E4B1E42-A831-44B4-A705-D006F68560EC}" file="WPO15\ENGraphics.msi" progresstext="Str.ProgressText.Common"/>
    <Dbm productcode="{19B4CD07-1919-4002-B28F-A5D2027026E0}" file="WPO15\IPM.msi" progresstext="Str.ProgressText.Common" cmdline="PCUSOURCEID=[PCUSOURCEID] ALLOW_PRODUCTUPDATES=&quot;[ALLOW_PRODUCTUPDATES]&quot; SERIALNUMBER=&quot;[SERIALNUMBER]&quot; USERNAME=&quot;[USERNAME]&quot; SHOW_EULA=[AcceptLicense] SKU=[SKU]"/>
    <Dbm productcode="{E539B721-4458-4EFC-8BD0-04D4842051AE}" file="WPO15\EN.msi" progresstext="Str.ProgressText.EN" cmdline="SKUDATA=&quot;[SKUDATA]&quot;" />
    <Dbm productcode="{D4167D08-0F61-4F44-BC3F-26B4960745C4}" file="WPO15\ENSkins.msi" progresstext="Str.ProgressText.EN" />
    <Dbm productcode="{64459BD5-3AE8-4689-B7B0-D57B667D8399}" file="WPO15\ENPExp.msi" progresstext="Str.ProgressText.Common" />
    <Dbm productcode="{1F0D7D15-8A36-4AE4-8573-70BEA7DF379D}" file="WPO15\MMan_EN.msi" progresstext="Str.ProgressText.Common" />
    Last edited by ssl6 (2012-04-10 02:05:44)

  • Help with my first PKGBUILD script [solved]

    Hi There
    I am trying to write my first PKGBUILD script and I am landing in a bit of trouble.  The script is short and is:
    #Contributor: iKevin <kellwood-at-ameritech.net>
    pkgname=fpm
    pkgver=0.60
    pkgrel=1
    pkgdesc="A password manager for gnome"
    url="http://fpm.sourceforge.net"
    license="GPL"
    depends=('xorg' 'gtk' 'glibc' 'libgnome' 'libxml2' 'glib')
    source=(http://heanet.dl.sourceforge.net/sourceforge/$pkgname/$pkgname-$pkgver.tar.gz)
    md5sums=(be7655d300c306c8f962f6aad0a60cc5)
    build() {
    cd $startdir/src/$pkgname-$pkgver
    ./configure --prefix=/usr
    make || return 1
    mkdir -p $startdir/pkg/usr/bin
    make prefix=$startdir/pkg/usr install
    I haven't reach the point where it compiles.  It failes to download the file.  Oddly, when I type:
    wget http://heanet.dl.sourceforge.net/source … .60.tar.gz
    it downloads fine.  When running makepkg, the contents of ./src/fpm-0.60.tar.gz is some kind of web page.
    I have eyeballed this PKGBUILD script for a while and I can't see any problems.  Is there something special about sourceforge files?  I feel that I must have a typo because makepkg is using wget, which works by hand.
    Thanks
    Kev

    Well,
    I installed kedpm with my first working PKGBUILD script.  I was able to import my "fpm" password file.  Once I get my gnucash stuff transfered into grisbi, I will be able to switch my main machine completely to archlinux.
    I know it is trivial for you guys, but here is my script -- it might save you some typing.
    Kev
    pkgname=kedpm
    pkgver=0.4.0
    pkgrel=1
    pkgdesc="Ked Password Manager helps to manage large amounts of passwords and related information"
    url="http://kedpm.sourceforge.net/"
    depends=(python pygtk pycrypto)
    makedepends=()
    conflicts=()
    replaces=()
    backup=()
    install=
    source=(http://dl.sourceforge.net/sourceforge/$pkgname/$pkgname-$pkgver.tar.gz)
    md5sums=('6b83a646873f8ea00af9c6403aa259bc')
    build() {
    cd $startdir
    mkdir -p pkg/usr
    cd $startdir/src/$pkgname-$pkgver
    python setup.py install --prefix=$startdir/pkg/usr

  • Help with "Print to PDF" Script...

    Hi All,
    I'm a Web Designer and I would need help creating a Print to PDF Script...
    Here's what I have:
    // Illustrator Export Script
    var difDocuments;
    difDocuments = documents.length;
        for(i=0;i<difDocuments;i++) {
            var aDocument;
            aDocument = documents[i];
            var docName;
            docName = aDocument.name;
            var docPath;
            docPath = aDocument.path;
            var docPathStr = docPath.toString();
                if (docPathStr.length>1) {
                    var documentPath;
                    documentPath = aDocument.path + "/" + aDocument.name;
                else {
                    var documentPath;
                    documentPath = "Z://Users//Fred//Chavi Files//Saved Exported PDF" + "/" + aDocument.name;
            var printOpts;
            printOpts = new PDFSaveOptions();
            printOpts.printPreset = "Print As PDF";
            var fileToSave;
            fileToSave = new File(docPath + "/" + "Saved Flat PDF" + "/" + aDocument.name);
            aDocument.print(fileToSave,printOpts);
    So what I'm attempting to do is to make a Print to PDF script rather then a Save As PDF, since print as PDF takes half the space...
    The settings would either be from a Print Preset or just by regular options...(if someone could make a list of the attributes and the "formatting" it'd be extremely appreciated...
    Thanks,
    Fred.

    I already tried that...my test file was around 60kb with the "Print as PDF" and 104kb using the "Save as PDF" and then Optimizing....
    I'm mostly doing the exporting to PDF on the Windows machine and I tested my script in Windows as well...
    Am I just formatting it wrong?
    It tells me:
    "Error 1242: Illegal argument - argument 1 - Object Expected
    Line: 30
    ->
    aDocument.print(fileToSave,printOpts);"
    and just before that I had a couple of "Constructor" errors...in the "Adobe Illustrator Scripting Guide" it was saying that:
    "The following objects must be created explicitly:
    Illustrator save options
    PDF save options
    PPD file
    PPD file info
    printer
    print flattener options
    print job options
    print options"
    What exactly do they mean? I created the objects like so: "object = new object();"
    It also mentionned a "var object = app.document[0].add();" Those are to create paths and shapes if I'm not mistaken (ActionScript background).
    Hopefully I'll find a way around this...
    P.S: how much slower would an Action be? And could an action be "transformed" into a Script?
    Thanks a lot for your help

  • Help with Difficult Sorting Task - Script Inside

    Hello,
    I have a very time consuming task that I would like to adjust the script below to help cut down the labor. The script below, will ask for a root folder and will copy all the folders inside that root folder to a secondary location. It will only copy the folders and not the files inside them. This works great. But my next step is to manually drag and drop the ".cos" files from the "master drive" from each shot folder to the emtpy "Settings50" folder that has been duplicated to my desktop. Is it possible in any way, to first copy the whole folder structure, and then only copy the "Settings50" folder and the files inside them to the secondary location? The image attached shows what I need duplicated in green and what I do not want duplicated in red. The reason I cannot simply copy the whole root folder is because the RAW files in red are very very large and takes forever to copy. I ONLY need the folder structure duplicated with the Settings50 folder copied with files inside them to a secondary location. If you can help out I would very very much apprecieate it!
    on run
              set source_folder to choose folder with prompt "Select folder to be duplicated:" as string
              my do_main_script(source_folder)
    end run
    on open of source_folder_list
              repeat with i from 1 to number of items in the source_folder_list
                        set this_folder_path to item i of the source_folder_list as string
                        if last character of this_folder_path is ":" then
                                  my do_main_script(this_folder_path)
                        end if
              end repeat
    end open
    on do_main_script(source_folder)
              tell application "Finder" to set source_folder to folder (source_folder)
              set the target_folder to (choose folder with prompt "Where would you like the duplicated folders to be moved to?")
              if source_folder is not "" and target_folder is not "" then
                        set new_folder_name to (name of source_folder as string) & " duplicate"
                        set source_folder to source_folder as string
                        set target_folder to target_folder as string
                        my create_new_folder(target_folder, new_folder_name)
                        my duplicate_folder_structure(source_folder, target_folder & new_folder_name & ":")
              end if
    end do_main_script
    on duplicate_folder_structure(source_folder, target_folder)
              tell application "Finder"
                        try
                                  get name of folders of folder (source_folder)
                                  set folder_list to result
                                  repeat with i from 1 to number of items in the folder_list
                                            set this_folder_name to item i of the folder_list as string
                                            my create_new_folder(target_folder, this_folder_name)
                                            my duplicate_folder_structure(source_folder & this_folder_name & ":", target_folder & this_folder_name & ":")
                                  end repeat
                        end try
              end tell
    end duplicate_folder_structure
    on create_new_folder(target_folder, new_folder_name)
              tell application "Finder"
                        try
                                  if not (exists item (target_folder & new_folder_name)) then
      make new folder at folder target_folder with properties {name:new_folder_name}
                                  end if
                        end try
              end tell
    end create_new_folder
    Thanks!
    Anthony

    Well, I think this will be close.  test it and see what needs to be improved.
    on run
              set source_folder to choose folder with prompt "Select folder to be duplicated:" as string
              my do_main_script(source_folder)
    end run
    on open of source_folder_list
              repeat with this_item in the source_folder_list
                        if last character of (this_item as string) is ":" then
                                  my do_main_script(this_item as string)
                        end if
              end repeat
    end open
    on do_main_script(source_folder)
              set the target_folder to (choose folder with prompt "Where would you like the duplicated folders to be moved to?")
              if source_folder is not "" and target_folder is not "" then
                        tell application "System Events" to set new_folder_name to (name of source_folder) & " duplicate"
                        set new_folder to checkForFolder(target_folder as string, new_folder_name)
      duplicate_folder_structure(source_folder as string, new_folder)
              end if
    end do_main_script
    on duplicate_folder_structure(source_folder, target_folder)
              tell application "System Events"
                        set folder_list to folders of folder source_folder
                        repeat with this_folder in the folder_list
                                  set this_folder_name to name of this_folder
                                  set new_folder to my checkForFolder(target_folder as string, this_folder_name)
                                  my duplicate_folder_structure(path of this_folder, new_folder)
                        end repeat
              end tell
              tell application "Finder"
                        set cos_file_list to every file of folder source_folder whose name ends with ".cos"
      duplicate cos_file_list to target_folder
              end tell
    end duplicate_folder_structure
    to checkForFolder(fParent, fName)
              tell application "System Events"
                        if not (exists folder fName of folder fParent) then
                                  set output to path of (make new folder at end of folder fParent with properties {name:fName})
                        else
                                  set output to (path of (folder fName of folder fParent))
                        end if
              end tell
              return alias output
    end checkForFolder

  • Help with an action refreshing script

    Hi,
    Ive been compiling a script to remove specific actions and load them up again. I work in a team where the action sets are updated regulary and this will make it easier to refresh. The script works great when run from the extendscript, but when called from a photoshop action it can remove the specified set but then does not load it up again. It throws no errors or anything.
    Below is the script, any help or ideas would be much appreciated!
    var checkstat = false;
    var w = new Window ("dialog", "Action Refresh");
    var stringOptions = [];
    stringOptions[0] = "EFFICIENCY";
    stringOptions[1] = "BANNERS & TEMPLATES";
    var imagename = w.add ("statictext", undefined, "Please select the action set you would like to refresh.");
    w.dropdownlist  = w.add("dropdownlist", undefined,"Baseline");
    var item
    for (var i=0,len=stringOptions.length;i<len;i++)
      {item = w.dropdownlist.add ('item', "" + stringOptions[i]);     
    w.dropdownlist.onChange = function() {
       //Save the selected value in a variable to be used later
       checkstat = stringOptions[parseInt(this.selection)];
    w.dropdownlist.selection = w.dropdownlist.items[0] ;
    w.buttonGrp = w.add ("group");
    var cancelbutton = w.buttonGrp.add ("button", undefined, "Cancel");
    cancelbutton.onClick = function() {   
       w.close(0);
        checkstat = false;
        return checkstat;
    w.buttonGrp.add ("button", undefined, "OK");
    w.show();
    if (checkstat == false){}
    else{
    try{
    delAction(checkstat); //Delete a specific action based on its name
    catch(e){}
    app.load(File("Z:/Editing/Actions & Templates/SITECORE/RETOUCHING ACTIONS/" + checkstat + ".atn")); //Load the action based on it's name from a pre-specified path
    function delAction(aName) {
        var idDlt = charIDToTypeID( "Dlt " );
        var desc1 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
        var ref1 = new ActionReference();
        var idASet = charIDToTypeID( "ASet" );
        ref1.putName( idASet, aName );
        desc1.putReference( idnull, ref1 );
        executeAction( idDlt, desc1, DialogModes.NO );

    So can you suggest what I should do to get the following outcome?  I am new to this...
    I need the fields for Listing Agent Commission and Selling Agent Commission.
    If Listing Agent is checked, need $35.00 deducted from Listing Commission Share to make the Listing Agent Commission.
    If Selling Agent is checked, but listing agent is not, I need the $35.00 deducted from Selling Commission Share to make the Selling Agent Commission.
    If Both are checked, I only need the $35.00 deducted from the Listing Commission Share, and the Selling Commission Share should Equal the Selling Agent Commission.
    If neither are checked, both fields should be 0.00.

Maybe you are looking for