My $20 to someone for writing this script...

Here is what I need to automate. I don't care if it's a Smart Folder, or an Apple Script, or an Automator work flow - whatever - just so it will work with my present setup. Once I test it and it works, I'll send $20 to the first person who can help me.
Script needs to apply to each (and every) MP3 file in a selected folder:
Open the first file with Fission (from Rogue Amoeba)
Select all
Normalize
Save audio (in same folder)
A warning dialog pops up: "File already exists..." -- answer with "Replace"
Close file
Repeat for next file in the folder, until every file has been Normalized
End script when the last file in folder has been Normalized
I don't mind finding the folder (which will be in my iTunes Library), and then starting the set of actions on the folder but I definitely don't want to be required to take any additional action on each and every file.
I'm presently running Fission v1.6.6 under MacOS 10.4.11 on a PPC desktop, so it needs to work in that environment.

The AS users hang out in the Apple Script forums. I would hate for any of them to miss out on your "offer."
!http://i50.tinypic.com/izvwo1.gif!

Similar Messages

  • Help me for writing the password script on solaris

    hi,
    help me for writing password scripts to change the user/root password.
    in the script itself myself want to mention the new password.
    now user want to login with the new password only.
    model script:
    echo $test:`perl -e '$x=crypt('$test123','test');
                   print $x'`::::::: >> /etc/shadow
    test--->username
    test123---->new password.
    the above script is not working.
    kindly help me for writing the script.
    Regards,
    raja

    Well. For one thing, if you just append the new password to the /etc/shadow file there will be two entries for the user in that file (at least if the user already had a password). Which probably is a bad thing.

  • Help for writing a Map with out JDeveloper

    Hi all,
    Where can I find help documents or sample files so that I can write a custom mapping between an Oracle Object and Java Object. Yeh, this might be a simple task when we use JDeveloper , but just for writing this small piece of code I am not in a position to download JDeveloper of size 230MB and learn how to use it...
    Plese give suggestions...
    Thanks in advance...
    Sateesh
    null

    Take a look at the JPublisher user's guide. You can also download JDeveloper in 20MB chunks if you can't download all 230MB at once.
    Blaise

  • [Solved] Could someone that knows awk good fix this script for me?

    I found this script on the linuxquestions site that tests and displays network bandwidth.  There's an error in the script though and my awk experience isn't enough to debug it and is giving me the error:
    awk: cmd. line:10: printf ("%4.0f", Ratio)}
    awk: cmd. line:10: ^ syntax error
    awk: cmd. line:10: printf ("%4.0f", Ratio)}
    awk: cmd. line:10: ^ syntax error
    ^C/home/todd/.bin/bandwidth-test: line 21: [: : integer expression expected
    BW Surchargé - Moyenne de de Kb/sec pendant 20 secondes
    This is the script:
    #!/bin/bash
    # bandwidth-test - test bandwidth from the command line
    Fic_Tmp="/tmp/Fic_Tmp_VerifRatio.tmp"
    NbrSec=20
    /usr/bin/bwm-ng -I eth0 -o csv -T avg -C " " -c ${NbrSec} | awk '
    BEGIN{
    BytesS=0
    NbrLecture=0}
    /eth0/&&NR>2{
    BytesS+=$5/1024
    NbrLecture+=1}
    END{
    Ratio=BytesS/NbrLecture
    printf ("%4.0f", Ratio)}' > ${Fic_Tmp}
    Ratio=$(cat ${Fic_Tmp})
    rm ${Fic_Tmp}
    if [ "${Ratio}" -lt 110 ];then
    echo "BW OK - Moyenne de ${Ratio} de Kb/sec pendant ${NbrSec} secondes"
    exit 0
    else
    echo "BW Surchargé - Moyenne de ${Ratio} de Kb/sec pendant ${NbrSec} secondes"
    exit 2
    fi
    exit $?
    Anyone available to fix this for me?
    Last edited by Gen2ly (2009-11-17 17:52:14)

    Ah, thought I counted all those.  Whoops .  Yep that did the trick.  Thanks benob.
    Edit: Just FYI to any that read this.  This script only checks if you are in the cap range, so it's not really a bandwidth tester for the command line.  The nearest I've found is 'iperf' which I'm unable to get to use yet.
    Edit2 : netperf seems better suited for this, only been able to learn how to do download speed test so far:
    netperf -c hostname -f K
    Last edited by Gen2ly (2009-11-17 19:08:38)

  • For multiple selection this script edit help

    2 or 3 selection text frame this script run?
    selection = app.activeDocument.selection;
    for (var j = 0; j<selection.length; ++j);
    var doc = app.properties.activeDocument, 
        myOnjectStyle = doc.objectStyles.itemByName = "myObj1", 
        myObjects, l;
    app.findTextPreferences = app.changeTextPreferences = null; 
    app.findTextPreferences.findWhat = "^a"; 
    myObjects = (app.selection && app.selection[j]).findText () || doc.findText (); 
    l = myObjects.length; 
    while(l--) myObjects[l].pageItems[0].appliedObjectStyle = myOnjectStyle;
    n = app.selection[j].textFrames.length;   
    while (n >= 0)   
         try {   
              var islem = app.selection[j].textFrames[n];
              islem.appliedObjectStyle = "myObj2";
         } catch(_) {}   
         n--;   

    sorry....i did't mention my error......this is my error...
    com.sap.tc.webdynpro.progmodel.context.ContextConfigurationException: DataNodeInfo(Listcustcntrlr.Zread_Input.Output.Es_Mara): structure field __Bev1__Luldegrp not found
    with regards,
    Gobi

  • Can this script be converted to a UNIX command for ARD?

    First I'd like to thank "Neil" again for providing the script below:
    set the_versions to (do shell script "mdls -name kMDItemVersion /Applications/Microsoft\\ Office\\ 2011/Microsoft\\ Excel.app")
    set the_versions to the_versions & return & (do shell script "mdls -name kMDItemVersion /Applications/Adobe\\ Reader.app")
    set the_versions to the_versions & return & (do shell script "mdls -name kMDItemVersion /Applications/Safari.app")
    set the_versions to the_versions & return & (do shell script "mdls -name kMDItemVersion /Applications/Google\\ Chrome.app")
    set the_versions to the_versions & return & (do shell script "mdls -name kMDItemVersion /Applications/Adobe\\ Acrobat\\ X\\ Pro/Adobe\\ Acrobat\\ Pro.app")
    set the_versions to the_versions & return & (do shell script "SW_vers")
    Output for this script yields exactly what I requested in the thread.  Ex:
    "kMDItemVersion = \"14.4.1\"
    kMDItemVersion = \"11.0.07\"
    kMDItemVersion = \"7.0.4\"
    kMDItemVersion = \"35.0.1916.114\"
    kMDItemVersion = \"10.1.10\"
    ProductName:          Mac OS X
    ProductVersion:          10.9.3
    BuildVersion:          13D65"
    I'd like to be able to run this command (or a variation) in Apple Remote Desktop (ARD) remotely, and as a UNIX command in order to generate a similar ARD report if possible.  Even better, I'd like the report to include the Application name and I'd like it to not to halt if an Application isn't present. My guess is that functionality like this for ARD would help a LOT of ARD Administrators because it would seem that the only way to do anything similar is to derive the metadata piecemeal (machine by machine) or end up having to wade through a ton of unwanted content using a full System Report...  Thanks.

    Forum software NOW prevents posting complete shell scripts. You'll have to piece together the code.
    First build an array of the applications that you are looking for in this form. Note; I truncated the applications.
    apps=( "/Applications/Microsoft Office 2011/Microsoft Excel.app" "/Applications/Adobe Reader.app" "/Applications/Safari.app" )
    Next loop thru the array
    for i in "${apps[@]}"; do
         printf "%s: %s\n" "$i" "$(mdls -name kMDItemVersion "$i")"
    done
    If you want to create a report then change the above loop to the following
    for i in "${apps[@]}"; do
         printf "%s: %s\n" "$i" "$(mdls -name kMDItemVersion "$i")"
    done > app_report.txt
    sw_vers >> app_report.txt
    Message was edited by: Mark Jalbert

  • Is this script still valid for setting up Drill through between HFM and FDM

    Guys hoping some one can shed a light.
    I am running hfm and fdm realese 11.1.1.3.000
    I am having issues setting up the SSO authentication (all the other steps have been done, and HFM is aware that I have uploaded information that can drill back). I am using an SSO script that was part of an Oracle presentation, but don't know if that script is still relevant.
    Here is a copy of the script (Visual Basic Script SSO Authentication) :
    Function AuthenticateSSO(token, applicationName)
    ' Place your single sign-on authentication script here
    ' To signify an authentication failure, you should
    ' raise an error by calling the following method:
    ' Err.Raise [error number over 1000], [source], [description]
    ' Applicationname = FDMApplication in URL
    Const strProcSig = "AuthenticateSSO"
    Dim strUsername
    Dim strDomain
    Dim objHFMSSO
    Dim strClusterName ' HFM cluster name
    Dim strAppName ' HFM application name
    Set objHFMSSO = CreateObject("upsIntBlockFM40C.clsHypeWindowFM")
    If Not objHFMSSO Is Nothing Then
    strClustername = "<xxxxxxxx>"
    Select Case ApplicationName
    Case "<xxxxxxxx>"
    strAppName = "<xxxxxxxx>"
    End Select
    strUsername = objHFMSSO.Connection.GetUsernameFromToken(CStr(Token), strClustername, strAppName)
    If Trim(strUsername & "") = "" Then
    ' Blank user name means the token is invalid.
    Set objHFMSSO = Nothing
    Err.Raise 2655, strProcSig, "The Single Sign-on token is invalid."
    Else
    ' Return the user name from the authenticated token.
    AuthenticateSSO = strUsername
    End If
    End If
    Set objHFMSSO = Nothing
    End Function
    After I input all the information requested, I always get the error Server Error in '/' Application. The resource cannot be found.
    Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
    Requested URL: /HyperionFDM/AuthorizedPages/IntersectionSummaryByLocation.aspx
    I did saw a note about this error that suggested that I needed to re-register and deploy again FDM. Did, but still have the same issue. So the only thing that I don't control is the script and that is why I am asking if this script is still active and usable?

    I have done all of that but I still get an error when trying to drill back. I am using the Admin ID which exist on both FDM and HFM but I am always getting the
    Server Error in '/' Application.
    The resource cannot be found.
    Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
    Requested URL: /HyperionFDM/AuthorizedPages/IntersectionSummaryByLocation.aspx
    So the only thing that I hadn't tried at the time was the SSO script. Which was what I did.

  • Powershell script for Use this termset for site navigation in tem store management tool in central admin

    can anyone pls point out whats the power shell script for "use this  termset for site navigation" in the termstore management tool in my central  admin';s manage serv appln-->managed metadata serv appln ->term styore mgmnt tool
    i would like to check this "checked" through powershell script
    help is appreciated!

    Hi,
    To check if the term set has been set to be used for site navigation, we need to check the
    NavigationTermSet.IsNavigationTermSet property for the term set.
    Here is the code example for using PowerShell to get the setting:
    $site=Get-SPSite "your site collection URL";
    $session = Get-SPTaxonomySession -Site "your site collection URL ";
    $termStore = $session.TermStores["Managed Metadata Service"];
    $Group = $termStore.Groups[“Group Name”];
    $TermSet = $Group.TermSets[“Term Set Name”];
    $navTermSet = [Microsoft.SharePoint.Publishing.Navigation.NavigationTermSet]::GetAsResolvedByWeb($termset, $site.RootWeb, "GlobalNavigationTaxonomyProvider");
    write-host $navTermSet.IsNavigationTermSet
    Best regards.
    Thanks
    Victoria Xia
    TechNet Community Support

  • Can someone please try this and see if this works for them...

    Hi there
    I cannot get the following to work but according to the mainstage manual this should work. Could someone please try this and see if this works:
    a. Create a new concert based on any template. Delete all patches except one (lets call this remaining patch X).
    b. Add a Bass instrument channel strip at the Concert level (by selecting the Concert in the patch list and then hitting the '+' button on the right within the Channel strips and selecting Software Instrument).
    c. Set the Concert level Bass instrument channel strip to play only on the first 2 octaves or so, by setting the Key Range parameters appropriately.
    d. Click on the remaining patch X. You should see that it automatically has your bass instrument as a split on the left hand octaves on the Mainstage keyboard displayed. So everything good so far.
    d. Now save the concert with any name.
    e. Close the concert.
    f. Re-open the same concert again. Click on the patch X. At this point I would expect the Bass instrument to be showing on the lower octaves. This does not happen for me.
    I've spent a couple of days trying to see if I'm doing something wrong, but cannot figure this out. Please please someone let me know the outcome of trying the above. And if I'm doing something wrong to get this to work, kindly let me know.
    thanks
    Ziggy

    Thank you all for your suggestions and taking the time to try this out. I think I've sussed out what the problem is.
    If you create them like Thor mentions that always seems to work. Thor, I don't understand what you mean by hitting the "+" in the channel strip area. Doing this creates an additional channel strip and not a new patch.
    What I was trying to do before was to include all patches in a set as well. So I have my Concert, then a Set, then patches within my Set. If I added a Bass at the concert level, it looks like this was then propagated to all my patches in my set. But when I closed Mainstage and re-opened, the bass wasn't there at the Set or patch level.
    I really think there is a bug with Mainstage, where if you have Sets and patches within sets, any instruments at Concert level do not get inherited by the Set, patches in the set. I've tried this a few times and tried without using Sets. It always seems to work without Sets.
    So the lesson is not to use Sets, if you want to share concert level intruments.
    Once again, thank you guys for trying this out.
    Ziggy

  • Modify this script for Time, not Date?

    I'm a complete newbie to scripting.  And I thought HTML was tough to pick up!
    I have this script-- apparently the only one I could find that comes close to what I need.
    // get new Date object
    var d = new Date();
    // format to mm/dd/yyyy
    var sDate = util.printd("mm/dd/yyyy", d);
    // insert date into form field
    this.getField("todaysDate").value = sDate;
    I need a script to perform this exact same operation but with the current system time (or MDT, that's fine).  I tried swapping out 'Date' for 'Time' but no go.  Anybody can help? 
    Much appreciated...
    -carrie

    Are you creating your form in Acrobat or LiveCycle Designer.
    For Acrobat forms:
    You can get a lot of different information from the date object by changing the format string for the 'util.printd' method. See the reference George Johnson links to for the format string values that can change the displayed value.
    // get new Date object
    var d = new Date();
    // format to h:MM tt
    var sDate = util.printd("h:MM tt", d);
    // insert date into form field
    this.getField("todaysDate").value = sDate;
    h - hours without leading zero
    MM - minutes with leading zero if necessary
    tt - am or pm designator
    For LiveCycle Designer you can select the 'Custom' form tab and then the 'Current Date' field. Now change the script to:
    $.rawValue
    = num2Time(time(), TimeFmt(1))
    More information about the time format is the 'Scripting Reference' under LiveCycle Designer's 'Help' menu option.

  • HT201441 i got this iphone 4 off of someone for $60 and its linked to a apple account and i don't have any contact to him now do i go to apple to activate it?

    i got this iphone 4 off of someone for $60 and its linked to a apple account and i don't have any contact to him now do i go to apple to activate it?

    Hello tom,
    I understand you are having issues activating an iPhone 3G. The following article addresses the exact error message you included:
    iPhone: Troubleshooting activation issues
    http://support.apple.com/kb/TS3424
    Resolution
    - Restart the iPhone.
    - Try another means of reaching the activation server and attempt to activate.
              - Try connecting to Wi-Fi if you're unable to activate using a cellular data connection.
              - Try connecting to iTunes if you're unable to activate using Wi-Fi.
    - Restore the iPhone.
    If you receive an alert message when you attempt to activate your iPhone, try to place the iPhone in recovery mode and perform a restore.
    Thanks,
    Matt M.

  • Could someone please check this for

    Hi there!
    I need someone to do this quick check, so I don't have to install Vista in vain.
    I mainly use MIDI interface for compositions and playback. So, could anyone please find a MIDI file with some FASTER parts, play it, and check if there are any dropouts or note misplacements?
    It was the issue in all previous driver versions, so please, somebody check this for me will ya?
    I have X-Fi Extreme Music.
    Thanks

    Here is the link to 2 faster midi files... If you have Windows Vista, X-fi and new drivers, please listen to them and tell me do they sound good or bad. Are there any dropouts, or any other issues?
    http://www.box.net/shared/2vxsohpagv
    Thanks.

  • I have bought a re conditioned i phone 3g for my daughter and when i have tried to sync it is not recongisnizing the phone and says no service.pleae could someone help as this is a present for tomro x

    Hi iv bought my daughter a reconditioned i phone 3g for christmas but when i have tried to sync the phone it is saying no service and the phone cannot be reconginized.please could someone help as this is a present for tomoro xx

    Where exactly did you buy it? Apple does not sell re-conditioned iPhones.

  • OK, for the third time writing this this session, after setting up iCloud on my IPMini, how do I access the clod to use the iWork apps?

    OK, for the third time writing this this session, after setting up iCloud on my IPMini, how do I access the clod to use the iWork apps?

    Note that you can not log into iCloud.com through the browser on an iOS device, only from a computer. If you want to use the iWork apps on your iOS device, you will need to purchase the apps from the app store if you don't qualify to get them for free.

  • !! Help for a looong script... begin with compare name of files, date...

    Hello Everybody, and thank you very much if you can answer to my little problem
    So here is the beginning of my script. At the end it will be a script to batch convert Psd files to jpeg in different resolutions, in different folders.
    I wanted to understand subtlety some parts of applescript, but I have to say that I failed for this case.
    So the part I am looking for is to compare files between two folders, not exactly like syncing.
    In the first Folder, psds files.
    In the second, Jpgs, wich have been made from the psds, with a 2nd part of the script, batch to jpeg.
    I want to compare these files to tell the 2nd script not to batch them to jpeg if they have not been modified.
    So the steps I would like to write :
    tell applescript to :
    1 -
    get every files of folder "psd" without invisibles
    get only the names of these files without extension
    get the modification date of these files
    2-
    get every files of folder "jpg" without invisibles
    get only the names of these files without extension
    get the modification date of these files
    3- compare the names of the files in psd's and jpg's folders (it's why I didn't want the extension)
    if some or all Psds already exist in jpg folder, then
    compare the modification dates of these same files
    and if these files in psd folder are more recent than in jpeg folder, then
    get only these modified files in psd folder, and, also the new ones (not existing in jpg folder).
    and --
    4 - launch my batchconverttojpg for this result
    (at this moment I only want to find steps 1, 2 and 3)
    --- It is important for me to do that, because the files in psd's folder will always change, and I can have really big files (like 500 or 800 mo each), and it will be really faster to batch only modified files…
    --- Here is the beginning of the script I am writing, but … bug bug bug, I don't find the good way to write that…
    set folder1 to "Macintosh HD:Users:Me:Desktop:test batch convert-script:psds" as string
    set folder2 to "Macintosh HD:Users:Me:Desktop:test batch convert-script:jpegs:Jpegs" as string
    set AppleScript's text item delimiters to ""
    tell application "System Events"
    set imgsources to every file of folder folder1 whose name does not start with "." and (file type is "psd" or file type is "JPG" or name extension is "psd" or name extension is "jpg")
    set imgcibles to every file of folder folder2 whose name does not start with "." and (file type is "psd" or file type is "JPG" or name extension is "psd" or name extension is "jpg")
    end tell
    --tell application "Finder"
    repeat with i from 1 to the count of imgsources without invisibles
    set img to (item i of imgsources as alias)
    set infosource to info for img
    set nameimg1 to name of infosource -- recupere le nom de limage + extension
    --set extimg2 to items -1 thru -4 of nameimg2 as text -- recupere l'extension
    set nimg1 to items 1 thru -5 of nameimg1 as text -- recupere le nom
    set moddateimg1 to modification date of infosource -- recupere la date de modif
    repeat with i from 1 to the count of imgcibles without invisibles
    set img2 to (item i of imgcibles as list) -- recupere tous les elements du dossier
    set infocible to info for img2 -- recupere les infos
    set nameimg2 to name of infocible -- recupere le nom de limage de destination
    set extimg2 to items -1 thru -4 of nameimg2 as text -- recupere l'extension
    set nimg2 to items 1 thru -5 of nameimg2 as text -- recupere le nom
    set moddateimg2 to modification date of infocible -- recupere la date de modif
    tell application "Finder"
    if nimg1 = nimg2 as text then
    --set nimg1 to nimg1 as string
    --set nimg2 to nimg2 as string
    --set name of img2 to folder2 & ":" & nimg2 & "-" & "2" & extimg2 as text
    set name of img2 to nimg2 & "-" & "2" & extimg2
    -- I am just trying to rename the file at this step.
    -- After this, I will compare the dates, and then, batch convert.
    end if
    end tell
    end repeat
    end repeat
    So if one of you have the good solution It will be a miracle for me
    I have to say that if I wrote this script in a simple way like that, it's to be able to understand what I do, or to understand the script after 6 month, without thinking about it…
    Thank you very much for your answers
    Fred

    Ok so there are a lot of things I didn't know about some details… And I see that I will never have succeed to write something like that…
    I don't really understand why to "set psdNames to --> {}" this last detail is unknown for me…
    And if I understand, the thing I missed is to do a listindex of the items ? it's why I didn't succeed to compare the files ?
    Then I though that it could be interesting for you or differents users to see the result. I think it works perfectly now.
    Of course, I am not professional in applescript editing, so if you have some comments or modifications, do not hesitate to post them here
    Thanks again to Red_Menace !
    Fred
    Here it is :
    (sorry I didnt translate all the notes to English. Just have to know that the script proceed in the folder where it is. If it's not save in the good folder before execute, or save as application in the good folder, then it will proceed in the default folder "applications"... so careful
    display dialog " Attention, Le script va créer un dossier psd, et déplacer les fichiers psds ici dans ce nouveau dossier" & return & " Et va ensuite procéder à la création de" & return & " Jpegs dans différents dossiers" buttons {"Ok", "Annuler", "+ d'explications"} default button "OK"
    if button returned of the result is "+ d'explications" then
    explications()
    return
    end if
    --Application utilisée : adobe photoshop CS3
    --Changer la version si besoin dans les lignes ci dessous
    --Changer le nom des dossiers ici, sans avoir à changer le reste du script
    set nomdossierpsds to "psds"
    set psdsFolder to nomdossierpsds
    set tempFolderName to "Exports"
    set tempfoldername1 to "Jpegs_HD"
    set tempfoldername2 to "Jpegs_SD"
    --Pour changer la taille des Jpegs SD --
    set choixtaille to "1200"
    tell application "Finder"
    set racine to get folder of (path to me) as Unicode text
    set nomprojet to name of folder racine
    --if folder psd exists but with different case
    if exists folder "psd" in folder racine then
    set name of folder "psd" in folder racine to psdsFolder
    end if
    if exists folder "Psd" in folder racine then
    set name of folder "psd" in folder racine to psdsFolder
    end if
    if exists folder "Psds" in folder racine then
    set name of folder "Psds" in folder racine to psdsFolder
    end if
    --2 -- check si le dossier psd existe, sinon le crée.
    if not (exists folder psdsFolder in folder racine) then
    make new folder in folder racine with properties {name:psdsFolder}
    set psdsFolder to folder psdsFolder in folder racine as alias
    open folder psdsFolder
    --display dialog "Avant de Continuer, Placer les images dans le dossier Psds" buttons {"Annuler"} default button 1
    else
    set psdsFolder to folder (racine & "psds") as alias
    end if
    --if Psd folder didnt exists, then move psd files in
    set psds to (files of folder racine whose name extension is "psd")
    move psds to folder psdsFolder
    --Dossier Jpegs Racine -- outputFolder -- check si present sinon creation
    if not (exists folder ((racine as string) & tempFolderName)) then
    set outputFolder to make new folder at racine with properties {name:tempFolderName}
    else
    set outputFolder to folder ((racine as string) & tempFolderName)
    end if
    --Dossier Jpegs HD -- outputFolder1 pour photoshop -- check si present sinon creation
    if not (exists folder (((racine as string) & tempFolderName as string) & ":" & tempfoldername1)) then
    set outputFolder1 to make new folder at outputFolder with properties {name:tempfoldername1}
    else
    set outputFolder1 to folder ((racine as string) & tempFolderName & ":" & tempfoldername1)
    end if
    set outputFolder1 to outputFolder1 as alias
    --Dossier Jpegs SD -- outputFolder2 pour photoshop -- check si present sinon creation
    if not (exists folder (((racine as string) & tempFolderName as string) & ":" & tempfoldername2)) then
    set outputFolder2 to make new folder at outputFolder with properties {name:tempfoldername2}
    else
    set outputFolder2 to folder ((racine as string) & tempFolderName & ":" & tempfoldername2)
    end if
    set outputFolder2 to outputFolder2 as alias
    end tell
    --recupere le chemin du dossier des psds à procéder
    tell application "Finder"
    set psdsFolder to folder (racine & nomdossierpsds) as alias
    end tell
    --1
    tell application "Finder" -- get file items from the folders (coerce list items to aliases for use later)
    set psdFiles to (files of folder psdsFolder whose name extension is "psd") as alias list
    set jpgFiles to (files of folder outputFolder1 whose name extension is "jpg" or name extension is "psd") as alias list
    end tell
    --2
    set psdNames to {} -- get the psd file names (these are in the same order as the file items)
    repeat with anItem in psdFiles
    set the end of psdNames to (justTheName from anItem)
    end repeat
    set jpgNames to {} -- get the jpg file names (these are in the same order as the file items)
    repeat with anItem in jpgFiles
    set the end of jpgNames to (justTheName from anItem)
    end repeat
    --3
    set filesList to {} -- figure out the files to process
    repeat with X from 1 to (count psdNames)
    set theName to contents of (item X of psdNames) -- get a name from the psd list
    if theName is in jpgNames then -- found a jpg match, so check the date
    set match to (listIndex of theName from jpgNames) -- get the index of the matching name
    tell application "Finder" -- look up the file items for the matching names and get the dates
    set psdDate to modification date of (item X of psdFiles)
    set jpgDate to modification date of (item match of jpgFiles)
    end tell
    if psdDate > jpgDate then set the end of filesList to (item X of psdFiles) -- newer file, so add
    else -- no match, so add
    set the end of filesList to (item X of psdFiles)
    end if
    end repeat
    filesList --> this list contains items (aliases) that are not in jpgsFolder or have a newer modification date
    tell application "Adobe Photoshop CS3"
    activate
    set display dialogs to never
    close every document saving no
    end tell
    repeat with aFile in filesList
    set fileIndex to 0
    tell application "Finder"
    -- The step below is important because the 'aFile' reference as returned by
    -- Finder associates the file with Finder and not Photoshop. By converting
    -- the reference below 'as alias', the reference used by 'open' will be
    -- correctly handled by Photoshop rather than Finder.
    set theFile to aFile as alias
    set theFileName to name of theFile
    end tell
    tell application "Adobe Photoshop CS3"
    activate
    open theFile
    set docRef to the current document
    set docHeight to height of docRef
    set docWidth to width of docRef
    ------------------------------------------------------------------- 1st Export to jpeg
    --Convert the document to a document mode that supports saving as jpeg
    flatten docRef
    tell docRef to convert to profile "sRGB IEC61966-2.1" intent perceptual with dithering and blackpoint compensation
    if (bits per channel of docRef is sixteen) then
    set bits per channel of docRef to eight
    end if
    --The first copy is simply saved with additional document info added
    set infoRef to get info of docRef
    set copyright notice of infoRef to "Copyright Frédéric Perrin"
    set docName to name of docRef
    set docBaseName to getBaseName(docName) of me
    --set fileIndex to fileIndex + 1
    set newFileName to (outputFolder1 as string) & docBaseName & ".jpg"
    save docRef in file newFileName as JPEG appending lowercase extension with options {class:JPEG save options, quality:12, format options:optimized}
    ------------------------------------------------------------------- 2nd export to jpeg
    -- The second copy is saved resized to width of 100 pixels proportionally
    -- There is no scale constraint in the resize image command.
    -- Use the height/width ratio to simulate the option.
    set ruler units of settings to pixel units
    set type units of settings to pixel units
    resize image current document width choixtaille height (choixtaille * docHeight / docWidth)
    -- repete la mise en memoire des variables, sinon des bugs
    set docRef to the current document
    set docName to name of docRef
    set docBaseName to getBaseName(docName) of me
    --set fileIndex to fileIndex + 1
    set newFileName2 to (outputFolder2 as string) & docBaseName & "-" & choixtaille & ".jpg"
    save docRef in file newFileName2 as JPEG appending lowercase extension --with options {class:JPEG save options, quality:12, format options:optimized}
    -- The original document is closed without saving so it remains as it was
    -- when opened for batch processing
    close current document without saving
    end tell
    end repeat
    -- Routines
    -- Returns the document name without extension (if present)
    on getBaseName(fName)
    set baseName to fName
    repeat with idx from 1 to (length of fName)
    if (item idx of fName = ".") then
    set baseName to (items 1 thru (idx - 1) of fName) as string
    exit repeat
    end if
    end repeat
    return baseName
    end getBaseName
    on justTheName from someFile
    get the name from a file path
    parameters - someFile [various]: a complete file path (POSIX or Finder)
    returns [text] - the base file name
    set someFile to someFile as text
    tell application "System Events" to tell disk item someFile
    set {theName, theExtension} to {name, name extension}
    end tell
    if theExtension is in {missing value, ""} then
    set theExtension to ""
    else
    set theExtension to "." & theExtension
    end if
    return text 1 thru -((count theExtension) + 1) of theName -- just the name part
    end justTheName
    to listIndex of anItem from someList
    get the (first) index of anItem in someList
    parameters - anItem [various]: the item to look for
    someList [list]: the list to look in
    returns [integer]: the index (0 if not found)
    set theIndex to 0
    repeat with X from 1 to (count someList)
    if (contents of (item X of someList)) is anItem then
    set theIndex to X
    exit repeat
    end if
    end repeat
    return theIndex
    end listIndex
    on explications()
    tell application "TextEdit"
    activate
    make new document
    set text of front document to ¬
    "--- Attention --- Le Script se lance pour gérer le dossier dans lequel il se trouve." & return & return & ¬
    "Pour ne plus voir ce message, ouvrir le script/application et l'éditer avec un éditeur comme Editeur applescript : Effacer alors le premier paragraphe --> End Message" & return & return & return & ¬
    "Il vérifie l'existence d'un dossier Psd, s'il existe, mais pas dans la bonne casse, renomme le dossier --" & return & "Donc -- attention -- si d'autres scripts sont chainés à ce dossier, il faudra mettre à jour la casse ou orthographe, sinon changer les variables en début de script afin que tous les scripts marchent avec le meme nom de ce dossier psd" & return & return & ¬
    "Une fois cela géré, le dossier -psds- est créé, sil n'est pas deja la. Les fichiers psds pouvant être présents à la racine du dossier, où se trouve le script, seront déplacés dans le dossier psd" & return & ¬
    "Ensuite, création d'un dossier jpeg contenant deux autres dossiers : jpgs HD et Sd, le 1er contiendra les jpegs à la resolution source du psd, le dossier Sd à la résolution de 1200px, soit acceptable pour le web ou le partage temporaire" & return & return & ¬
    "Pour finir, le script peut être relancé à l'infini, les dossiers se synchronisent en fonction du dossier Psd et JpegsHD. Si de nouveaux fichiers se trouvent dans le dossier Psd, ou bien sils ont été modifiés, alors ils seront re-batchés en jpegs dans les dossiers correspondants." & return & ¬
    "Donc -- Attention -- , ne jamais faire de retouches sur les fichiers Jpegs, seulement sur les psds, et -- attention-- aussi, les fichiers jpegs correspondants aux psds retouchés seront écrasés" & return & ¬
    "Pour conserver des versions des fichiers, à la main, renommer séquentiellement les psds à l'enregistrement dans photoshop, ainsi les jpegs seront séquentiels aussi" & return & return & return & ¬
    "La préférence, de choisir à la main la séquence des fichiers psds semble être plus pratique à l'usage, et de garder un minimum la main sur les images, afin de s'y retrouver" & return & return & return
    end tell
    end explications
    -------------------------------------------------------------------

Maybe you are looking for