Run a script when DND is on

I saw that Messages.app has an AppleScript handler and I thought about making a script to change my status to "Away" or "DND" when Do Not Disturb feature of Notification Center is on. But I don't know how to "talk" to AppleScript regarding the DND feature of NC. I used AppleScript once or twice for simple tasks when I told Finder or Mail to do something simple, but now I don't know how to do this.
I think that the "pseudocode" should be something like
tell application "Messages" to (if DoNotDisturb is ON set status to "Away")
but I don't know how to make it understandable by AppleScript. More precisely, I don't know how to refer to the DND state of Notification Center.
Any help well appreciated. Thanks.

Hi,
If you Open AppleScript Editor you can use the File Menu to Open Dictionary.
You will get a window full of the apps and items that have AppleScript Dictionaries.
From here I opened the System Preferences one (There seemed to be no Notifications one)
I looked at the two sets of items (Standard Suite and System Preferences).
The second seems to be the one to use.
It seems you could get AppleScript  to reveal the Panes and the Anchors as they are called within the pane.
However when I try:-
using terms from application "System Preferences"
    reveal pane
end using terms from
I get an error message.
At this point my skills at AppleScript are exceeded to know what to do next.
Aside from that Messages 7 (Mountain Lion) and earlier iChat version had an Alert section to the Preferences.
These had seventeen different actions of things that could be set such as Buddy Coming On-line (Available), Messages Sent and well as th Message Received that is now in the General Section.
You could set Sound, Dock icon bounces and Applescripts to each of these.
I had two;  the first was set for AV Chat Started which changed the Status Message and the Input and Output volumes and the second for AV Chat Ended which said I had been busy but was no longer and changed the volume back.
I would have to run these as External Scripts (not set in the option you describe) but I have not down this yet.
I don't think the current option can be set to anything other than Message Received and you want to do things to the Status Message before then, control be an event in another app.
10:14 pm      Saturday; January 25, 2014
  iMac 2.5Ghz 5i 2011 (Mavericks 10.9)
 G4/1GhzDual MDD (Leopard 10.5.8)
 MacBookPro 2Gb (Snow Leopard 10.6.8)
 Mac OS X (10.6.8),
 Couple of iPhones and an iPad

Similar Messages

  • Launchd - can it run a script when users log in OR switch?

    I'm hoping to find someone who knows all the gory details of launchd. Here's the why and what: I'm trying to coerce Aperture into letting two users on the same computer share the same Aperture Library, both able to import photos and see and use what the other has done. Initially it is no problem, change the permissions so everyone has read/write/execute, put the Library in a common area, and point both person's Aperture at it. The problem is that Aperture changes permissions of things inside the Library as you use it, and especially when one person imports, the other person can't see that stuff.
    So I want to run a script whenever someone logs in or becomes the active user by fast user switching; the script will simply change ownership and permissions of the library and everything in it to restore full access.
    After days of research and testing, I made a test launchd plist file (this is the configuration file or agent that launchd looks at and runs your script when criteria are met). It sits in /Library/LaunchAgents/, here it is:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    <key>Label</key>
    <string>org.jim.test</string>
    <key>LimitLoadToSessionType</key>
    <string>LoginWindow</string>
    <key>ProgramArguments</key>
    <array>
    <string>/Library/Scripts/testscript.sh</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
    <key>StandardErrorPath</key>
    <string>/Users/jim/Desktop/test.err</string>
    <key>StandardOutPath</key>
    <string>/Users/jim/Desktop/test.out</string>
    </dict>
    </plist>
    The actual test script is sitting in /Library/Scripts/:
    #!/bin/bash
    echo "org.jim.test.plist was run at `date`"
    So if the plist is loaded and the script run, the date and time are written in the test.out file on my desktop. This thing runs great when a user logs in. The problem is, it doesn't run when users switch by fast user switching. In reading the documentation, it was vague about this, whether that could be done; I thought it could.
    Can anyone help with a way to get the script to run when any user takes control by any means? As an added complication, which I'll worry about later, the script has to run as root because it's the only way to get the ownership and permissions changed.
    Thanks,
    Jim

    BobHarris is the MAN. ACLs seem to have worked. I put the Aperture Library in /Users/Shared/ApertureLibrary, restored the regular permissions as best I could (me as owner, staff as group, 755), pointed each person's Aperture to the library, then proceeded with the ACL magic. First I created a group for my wife and I, called 'aperture', in the Accounts preference pane. That was to simplify the ACLs (one entry instead of 2) and so that other users (son) aren't able to muck it up.
    It took one stinking Terminal command (note that 'aperture' at the beginning of the quote is the group, not the program, folder or library):
    chmod -R +a "aperture allow list,addfile,search,delete,add_subdirectory,delete_child,file_inherit,directoryinherit" ApertureLibrary.aplibrary
    I was unsure whether this list of permissions was necessary or sufficient, but it seems to have worked so far. Both users can access the library. I imported a different picture by each user, and the other user could then see and delete the picture imported by the other. This was not possible before.
    Bob, thanks for the great idea. After a little more testing I'll post a complete how-to in the latest "how do we share Aperture" thread, and give you due credit. The bad news is all the launchd fun is over
    Jim

  • Have terminal NOT run a script when it loads

    I recently wrote a basic shell script and saved it as a .command file to run from the desktop. Since then, whenever I open the terminal it automatically runs the script then exits the terminal. If I hide the file (mv pt-noplugs.command .ptnoplugs.command) it simply opens the terminal and closes it immediately. I have tried changing the default shell from bash to something else but this doesn't seem to make a difference. I also don't seem to have a .bashrc file when it normally is /home/user/.bashrc (I'm used to linux). Any help would be appreciated. Below is the script:
    # Shell Script to start Pro Tools HD with no waveshell Plug-In
    echo "*"
    echo "* Script: pt-noplugs.command"
    echo "* Please Leave This Window Open Until ProTools Has Exited"
    echo "*"
    # Move waveshell Plug-In Files to Plug-Ins (Unused)
    cd "/Library/Application Support/Digidesign/Plug-Ins/"
    mv -v Waveshell-DAE_5.9.1.dpm "../Plug-Ins (Unused)"
    # Start Pro-Tools
    /Applications/Digidesign/Pro\ Tools/Pro\ Tools\ HD.app/Contents/MacOS/Pro\ Tools\ HD
    # Restore Plug-Ins directory
    cd "../Plug-Ins (Unused)"
    mv Waveshell-DAE_5.9.1.dpm ../Plug-Ins
    echo "*"
    echo "* Thank You. This Window May Now Be Closed"
    echo "*"
    exit

    I forgot to add: when I login as a different user and load terminal is does NOT run the script mentioned before.

  • Is it possible to run a script when changing Yoga modes?

    I'm currently working with a vendor of Restaurant reservation software and they have a customer that would like to implement the Yoga 13 for a chain of hotels. However, due to the fact that the software requires Silverlight, it's necessary to run a script so that they can use Google Chrome and have the software keyboard pop up automatically when a text field is entered or touched. 
    I can easily run the script at login and manually unload it when done, but since Lenovo already has software (Lenovo Transition) that can trigger things when the Yoga changes modes, is there some sort of developer tool or a system-wide event that can be used to automatically load and unload the script on mode change?
    Please let me know, some Yoga sales could depend on this....and I love the Yoga.

    Well, I'm looking for a means to activate a script through the active corners, I'm not asking any questions about the script itself, so I did not think it should be posted in the AppleScript categoriy, but sure, I'll give it a go.
    (New thread in AppleScript: http://discussions.apple.com/thread.jspa?threadID=2534773&tstart=0)
    Message was edited by: Max Ocklind

  • Run a script when folders are deleted?

    I'm just playing with idea I was thinking of have a Plist in the launchd folder so that when the certain folders of the desktop are deleted it would run a script to collect information about the folders that were deleted.
    Folders begining with FR and DO are moved to the trash by user, then
    get number of items in each of the folder and write to a CSV file.
    I just need something that will reconise the items moved to continue the rest of the script.
    Any suggestions please?
    Its actually to link it to this script that is a work in progress.

    maybe something close to this?
    tell application "Finder"
              set hotFolder to folder "Hal 9000:Users:matthew:Desktop:HotFolder"
              set keyFolder to folder "Hal 9000:Users:matthew:Desktop:Keywords"
              --The above 2 folders will always exist if there are no other folders exist on the dektop then run the rest of the script else do nothing.
              if (exists (only folder hotFolder and keyFolder)) then
                        display dialog "Only these Folders exist"
                        else
                        display dialog "Other folders exist!" 
              end if
    end tell

  • How can I run a script when an application quit??

    Greetings all,
    I'm trying to write a script, which can be triggered automatically (to do some stuff) at the time when a given application quit. I was playing around with this test script, taking "TextEdit" as an example - it just prints a message when TextEdit exits.
    ==========================================
    +*set targetapp to "TextEdit"*+
    +*tell application "System Events" to set rr to name of the processes*+
    +*--if targetapp is not in rr then*+
    +*-- tell application targetapp to activate*+
    +*-- tell application "System Events" to set rr to name of the processes*+
    +*--end if*+
    +*set rr1 to rr*+
    +*repeat until rr1 ≠ rr and targetapp is not in rr1*+
    +*tell application "System Events" to set rr1 to name of the processes*+
    +*do shell script "sleep 1"*+
    +*end repeat*+
    beep
    +*display dialog (targetapp & " is not active anymore !") as string buttons {"OK"} default button 1 with icon 0*+
    ============================================
    Unfortunately, it seems to work if I launch TextEdit using the script itself; it doesn't work with first +*"if - end if"*+ block commented out. Does anyone know how can I achieve this? Any help or suggestion greatly appreciated. Cheers!!

    Hi santanu,
    I'm sure you can use a variation of this application of mine to do what you want. It monitors all running processes and then reports when one closes.
    --initialize previous_processes
    global previous_processes
    tell application "Finder"
    set previous_processes to get the name of every process --use "whose visible is true" to remove the background ones
    end tell
    --monitoring script
    on idle
    tell application "Finder"
    set current_processes to get the name of every process
    end tell
    set numberofprocesses to count of items in previous_processes
    set counter to 1
    repeat while counter is less than (numberofprocesses + 1)
    if current_processes does not contain item counter of previous_processes then
    display alert item counter of previous_processes & " quit!"
    end if
    set counter to counter + 1
    end repeat
    set previous_processes to current_processes
    return 1 --runs every second...can be changed
    end idle

  • Auto run sql script when DB opens

    Is it possible to configure a DB so a given SQL script is run each time the database opens?
    Thanks a lot in advance.

    rafadc wrote:
    Is it possible to configure a DB so a given SQL script is run each time the database opens?
    Thanks a lot in advance.Either include the script in a startup script for the database, dbstart on *nix you'd need to write your own on windows, or else move the code into a startup trigger.
    Niall Litchfield
    http://www.orawin.info/

  • Run a script when mpd wants to play a song

    Hi,
    I have built a power strip I can control through USB. Now I have teach my computer how to turn on or off a plug , I would like that it turns on automatically  my speakers when my computer play a song and turns it off when it stops.
    As the music is controlled by mpd, I would like to know if it is possible to add this functionality to mpd? Or do I have to tell Alsa to make this work (how?)? Or do I have to make a daemon which will check whether a song is played or not?
    Thanks

    You would write a simple mpd client for such a task usually. (not sure if perhaps 'mpc' has this built-in already)
    Example C-program using libmpdclient that wakes up once mpd plays a song or stops playing:
    * Compile: gcc mpdsonglisten.c -o mpdsonglisten -lmpdclient -std=c99
    * Run: ./mpdsonglisten localhost 6600 <on_play_script> <on_stop_script>
    * Example: ./mpdsong localhost 6600 'echo plays!' 'echo stopped!'
    * It will call on_play_script once mpd starts playing,
    * and on_stop_script once it pauses, stops or does something unknown.
    * Error handling is done by ignoring none-fatal erros and trying to reconnect if
    * fatal errors happen.
    #include <mpd/client.h>
    #include <stdlib.h>
    #include <unistd.h>
    #include <signal.h>
    #include <stdio.h>
    static volatile bool not_ctrlc_pressed = true;
    static bool check_error(struct mpd_connection * client)
    if(mpd_connection_get_error(client) != MPD_ERROR_SUCCESS) {
    printf("Error: %s (Retry in 1 second...)\n", mpd_connection_get_error_message(client));
    if(!mpd_connection_clear_error(client)) {
    mpd_connection_free(client);
    sleep(1);
    return true;
    return (client == NULL);
    static struct mpd_connection * connect(const char * host, unsigned port)
    struct mpd_connection * client = NULL;
    for(;;) {
    client = mpd_connection_new(host, port, 2000);
    if(check_error(client)) {
    continue;
    break;
    return client;
    void cancel_signal(int signal)
    if(signal == SIGINT) {
    not_ctrlc_pressed = false;
    int main(int argc, char const *argv[])
    if (argc < 3) {
    printf("Usage: prog <hostname> <port>");
    return EXIT_FAILURE;
    int previous_sond_id = -1;
    enum mpd_state prev_state = MPD_STATE_UNKNOWN;
    struct mpd_connection * client = connect(argv[1], strtol(argv[2], NULL, 10));
    signal(SIGINT, cancel_signal);
    while(not_ctrlc_pressed) {
    enum mpd_idle events = mpd_run_idle (client);
    if(check_error(client)) {
    client = connect(argv[1], strtol(argv[2], NULL, 10));
    continue;
    if (events & MPD_IDLE_PLAYER) {
    struct mpd_status * status = mpd_run_status(client);
    if (status != NULL) {
    enum mpd_state play_state = mpd_status_get_state(status);
    int current_song_id = mpd_status_get_song_id(status);
    switch(play_state) {
    case MPD_STATE_PLAY:
    if (current_song_id != previous_sond_id && prev_state != play_state) {
    previous_sond_id = current_song_id;
    if (argc > 3)
    system(argv[3]);
    break;
    case MPD_STATE_UNKNOWN:
    case MPD_STATE_PAUSE:
    case MPD_STATE_STOP:
    previous_sond_id = -1;
    if (argc > 4)
    system(argv[4]);
    break;
    prev_state = play_state;
    if(client != NULL) {
    mpd_connection_free(client);
    return EXIT_SUCCESS;
    (also as gist here: https://gist.github.com/sahib/6718139)
    Edit: Added error handling // do not consume 100% cpu when connection fails.
    Last edited by SahibBommelig (2013-09-26 18:07:56)

  • Getting an app to run a script when it is feeling uncooperative?

    Trying to get Image Capture to run an Applescript instead of an application (usually AutoImporter) but it keeps the script (.scpt) greyed-out. How can I outwit this behaviour, please? Write a bash script instead, or will IC just chole on that too?

    If it will work at all, it will have to be an application. So save your AppleScript as an Application, not a Script.

  • Use Launchctl to run a script when a program dies

    I have a faceless app that must be started by an AppleScript. This process is necessary because the faceless app  executes handlers that are loaded into it by the AppleScript.The AppleScript should be run at startup, and at any time the faceless app dies.
    If I simply start the faceless app directly, it will do nothing until it has the handlers loaded via the AppleScript.
    I would like to use launchctl to monitor the faceless app and should it die, run the AppleScript, which I can save as an app.  Note that the AppleScript itself should not be kept alive. It runs and dies immediately after it starts the faceless app and loads the handlers.  The problem is I can't find a way to create this "link" between the main app and the startup script. I looked at keepAlive, OtherJobEnabled. But, that seems to key off of the Disabled tag rather than the actual instance of the running program.  I also considered using WatchPaths but the faceless app does not seem to open files (it reads data from a socket on a remote mnachine)
    Here are the two agent plists I have (that do not work).  First, the AppleScript plist:
    <dict>
              <key>Label</key>
              <string>com.phidgets.phidgetsOsaStarter</string>
              <key>Program</key>
              <string>/Users/rdp/Desktop/Projects/Phidgets/AppleScript/1998-Phidgets-Control- rev_c</string>
              <key>RunAtLoad</key>
              <true/>
              <key>KeepAlive</key>
              <dict>
              <key>OtherJobEnabled</key>
              <dict>
              <key>com.phidgets.phidgetsOSA</key>
              <false/>
              </dict>
              </dict>
    </dict>
    and the faceless app plist:
    <dict>
              <key>Label</key>
              <string>com.phidgets.phidgetsOSA</string>
              <key>Program</key>
              <string>/Library/ScriptingAdditions/PhidgetsOSA</string>
              <key>RunAtLoad</key>
              <false/>
              <key>KeepAlive</key>
              <false/>
    </dict>
    I would greatly appreciate any ideas on how to approach this.
    FYI, For those that are interested, the facless app, PhidgetsOSA, provides an interface to a Phidgets controller (www.phidgets.com)

    So, I just took the easy way (for me) out. This will work until something better comes along...
    #!/bin/ksh
    while true
    do
      if [[ ! `ps ax|grep PhidgetsOSA|grep -v grep` ]]
      then
      /usr/bin/osascript /Users/rdp/Desktop/Projects/Phidgets/AppleScript/1998-Phidgets-Control-rev_c.sc pt
      /usr/bin/osascript -e "tell application \"IndigoServer\" to log \"restarted PhidgetsOSA\" using type \"Phidgets Watchdog\""
      fi
      sleep 15
    done&
    The first osascript call runs the AppleScript to start my app. The second one prints a log message in my HA app's log.

  • Why does my MBA freeze at "running package scripts" when loading.en trying to load itunes 10.4

    Can download the 92 mb of upgrade, but cannot get it to get beyond 2 mins and close itunes.

    Thanks, Tom
    you took me back to first principles (forced me out of laziness, i guess) and another half-day of trying again during which i incrementally reduced the upgrade back to the original condition - video, then ram, then processor - finally brought the machine to life again with new install on the new 120gb disc of 10.4.6 now upgraded to 10.4.10
    i am now restarting the upgrade with additional increments learned through this affair, such as testing memory one item at a time to check the machine's view of its compatibility; proposing to start with the ram - on the grounds it should be simplest (after using memory checker), then video, finally then processor.
    hope to discover the source of the gremlin and will report what i find, just in case others could benefit
    again, thanks for taking an interest
    best regards
    crish
    hope to uncover just what was the cause of the failures

  • How can I run a script on suspend/resume?

    I'd like to run a script when a machine is about to suspend and another after it resumes. Is this possible?

    You can pipe the results of Out-Command to Out-File (or Export-Csv, etc.)  I'm not sure what kind of objects you're expecting from this script, so I'll err on the side of caution and use Format-List * in the example:
    Invoke-Command -ComputerName $servers -FilePath c:\copy.ps1 |
    Format-List -Property * |
    Out-File -FilePath $home\Desktop\copy.log

  • Run a script by clicking on a button panel

    Hi,
    i am very new to scripting in after affects and in general.
    Several month ago i write severals little scripts to speeds up my workflow. I launch them via the "Launch Pad" script Panel.
    Now, i would like to put my scripts in my own panel but i'm missing the properties to link the "script part" and the "panel part".
    For the panel i have (just one button for the moment):
    win=new Window("window","new project",[0,0,500,500],{resizeable:true,});
    but_1=win.add("button",[33,16,103,36],"Sharpen3Way");
    win.center();
    win.show();
    and  my previous script that work independently.
    myComp = app.project.activeItem;
    // Selectionne la composition active
    app.beginUndoGroup("Sharpen 3 Way");              
    // Start Undo Group
    mySolid01 = myComp.layers.addSolid([100,100,100], "Sharpen", myComp.width, myComp.height,1);   // Ajoute un layer Solid
    mySolid01.adjustmentLayer = true;                                                                                             
    // Transforme le Solid en Adjustement Layer
    mySolid01.label = 5;                                                                                                                   
    // Attribue la couleur d'un Adjustement Layer
    mySolid01.opacity.setValue(40);                                                                                                  
    //  Change l'opacité du Layer
    myEffect = mySolid01.property("Effects").addProperty("Unsharp Mask").name = "Unsharp Mask Large";  
    // Ajoute un effet  sur ce calque 
    myEffect = mySolid01.Effects.property("Unsharp Mask Large")(1).setValue(10);
    myEffect = mySolid01.Effects.property("Unsharp Mask Large")(2).setValue(40);
    myEffect = mySolid01.property("Effects").addProperty("Unsharp Mask").name = "Unsharp Mask Medium";
    // Ajoute un effet  sur ce calque 
    myEffect = mySolid01.Effects.property("Unsharp Mask Medium")(1).setValue(65);
    myEffect = mySolid01.Effects.property("Unsharp Mask Medium")(2).setValue(1);
    myEffect = mySolid01.property("Effects").addProperty("Unsharp Mask").name = "Unsharp Mask Fine";    
    // Ajoute un effet  sur ce calque 
    myEffect = mySolid01.Effects.property("Unsharp Mask Fine")(1).setValue(95);
    myEffect = mySolid01.Effects.property("Unsharp Mask Fine")(2).setValue(0.5);
    app.endUndoGroup();            
    // End Undo Group
    How do i make the relation to run the script when i click on the but_1 ("Sharpen3Way")
    thanks you.

    Hi,
    if you don't have that many scripts and they are short like this, you can make them into functions, and on click events the function is called.
    A bit off topic but i think important, (1) avoid windows of type window, palettes are better, (2) you should use the keyword "var" when declaring new variables,
    (3) to make it dockable have a look at David Torno's tutorials ([Tutorial] After Effects ExtendScript Script Writing).
    Edit : And also (4) You should use matchNames (or index) to refer to properties, not english name. If you hand this script to someone who does not have AE i english, it will probably not work
    For instance myEffect should be instead: myEffect = mySolid01.property("ADBE Effect Parade").addProperty("ADBE Unsharp Mask2");
    Xavier.
    (function(){
        var win, but_1, but_2;
        win = new Window("palette","new project",[0,0,500,500],{resizeable:true,});
        but_1=win.add("button",[33,16,103,36],"Sharpen3Ways");
        but_2=win.add("button",[33+100,16,103+100,36],"Sharpen0Way");
        but_1.onClick = sharpen3Ways;
        but_2.onClick = sharpen0Way;
        win.center();
        win.show();
        function sharpen3Ways(){
            var myComp, mySolid, myEffect;
            // Selectionne la composition active
            myComp = app.project.activeItem;
            if (myComp instanceof CompItem){
                app.beginUndoGroup("Sharpen 3 Way");                  // Start Undo Group
                // Ajoute un layer Solid
                mySolid01 = myComp.layers.addSolid([100,100,100], "Sharpen", myComp.width, myComp.height,1);
                mySolid01.adjustmentLayer = true;                                                                                                      // Transforme le Solid en Adjustement Layer
                mySolid01.label = 5;                                                                                                                            // Attribue la couleur d'un Adjustement Layer
                mySolid01.transform.opacity.setValue(40);                                                                                                          //  Change l'opacité du Layer
                // Ajoute un effet  sur ce calque (unsharp mask)
                myEffect = mySolid01.property("Effects").addProperty("Unsharp Mask");
                myEffect.name = "Unsharp Mask Large";   
                myEffect(1).setValue(10);
                myEffect(2).setValue(40);
                // Ajoute un effet  sur ce calque (unsharp mask)
                myEffect = mySolid01.property("Effects").addProperty("Unsharp Mask");
                myEffect.name = "Unsharp Mask Medium"; 
                myEffect(1).setValue(65);
                myEffect(2).setValue(1);
                // Ajoute un effet  sur ce calque (unsharp mask)
                myEffect = mySolid01.property("Effects").addProperty("Unsharp Mask");
                myEffect.name = "Unsharp Mask Fine";
                myEffect(1).setValue(95);
                myEffect(2).setValue(0.5);
                app.endUndoGroup();                // End Undo Group
            else{
                // ignore or send some alert
            return;
        function sharpen0Way(){
            alert("About to do something, ... dont know yet what.");
        return;

  • Run a script on file open?

    I realize there is a way to run scripts when AI launches, but is there a way to run a script when AI opens a file?

    Hi Mordy,
    Sorry, I replied the same thing below as the other post and not sure if you would go back so... :)
    Thanks a lot for your reply. Thats ALMOST exactly what I need and so close to what I have been stressing over its unreal...
    ...although because I am not opening a new template and I am opening a direct tiff image from video footage I previously rendered out in after effects to then run my script on in illustrator for the additional tiff's, I would need a similar sort of thing that way around instead?
    Would you know if that is possible?
    Thanks again for your help with this...

  • Is it possible to run a script through active corners?

    Is there any way or app that allows me to run a script when moving the mouse pointer to an active corner (the ones otherwise used by Exposé)?

    Well, I'm looking for a means to activate a script through the active corners, I'm not asking any questions about the script itself, so I did not think it should be posted in the AppleScript categoriy, but sure, I'll give it a go.
    (New thread in AppleScript: http://discussions.apple.com/thread.jspa?threadID=2534773&tstart=0)
    Message was edited by: Max Ocklind

Maybe you are looking for