Actionscript/batch - keeps replacing files

I setup an actionscript/file-batch that opens PDFs and then saves them using the "save for web" option. Nothing major.
However, because of the new open dialog box for PDFs in CS3, a file name is given. The problem with that is now that file name is used for every file that is opened in the batch, and so the same file gets saved over and over replacing itself instead of creating all new files.
And because it's using "save for web" instead of "save as JPG" command (I get better compression results) , I can't use any of the "destination" options like "starting serial number", etc., in the batch dialog box.
I tried leaving the name empty in the PDF open dialog box, but then it just does the same thing with the file named "untitled".
What am I missing here? I'm sure it's really simple.
Thanks,
Dave

I'm having the exact the same problem here (going from multiple PDF's to Save For Web JPG or GIF) It seems that the "Override Action Open Commands" don't work when batching, as all files takes the original PDF name.
As another user correctly wrote (Mark Griffin): The Open needs to be recorded as you can specify the PDF raster settings there. No, It open the file sequentially OK, it's the saving that's the issue. Keeps saving to whatever the filename that was specified in the Export for web dialog

Similar Messages

  • "Keep Both Files" is NO Substitute for "Do Not Replace"

    Can someone please post a Terminal command sequence to disable the "Keep Both Files" option in the Finder copy dialog? It's useless to me and I've already wasted several hours trying to manually work around this bug and shut it off on my own. Anyone with a digicam hobby will quickly run into the huge drawbacks of the loss of this feature.
    I routinely deal with thousands of individual files on a daily basis; the file names repeat very frequently and the files arrive from multiple sources, therefore these files do NOT all have unique identifiers and each batch can be hundreds of GB. They all need to be moved and backed up weekly or more frequently. On a daily basis I move between 250-500GB of files between directories and from devices to the computer, et cetera. Without this function there is literally not enough time in the day to carefully manage a production system, which equates to a waste of time, electricity, and brain power on mundane tasks. Who keeps their entire file tree on paper so they can refer during copying between directories?
    Windows 7's mostly useless "Keep Both Files" feature has no place in a system as useful as Apple's. It really doesn't help with anything other than to offer a rubber bumper to protect inattentive people from overwriting files, which was elegantly in place up until Lion. Come on, you can't GUI someone's inattention out of the equation. If you could, would I be typing this?....
    Listen, by removing the "Do Not Replace" option from the finder copy dialog, I am forced to either increase storage space--I can't believe I need to explain this, but I will say "unnecessarily" just to be redundant--or alternatively I must copy EVERY FILE???!!!! So, if only 50 files out of 1,800 need to be copied I still have to move all 1800 or sort through them one by one.
    You have got to be joking. Give me a Terminal rip to kill this behavior please. This is an amazingly full-fleshed waste of time. It seems obvious enough that this is a programming SNAFU. "Do Not Replace" has been removed from the Finder copy dialogue because Lion actually cannot do both that and "Keep Both Files."
    So, who knows the code for Terminal to revert this behavior to the pre-Lion days? Post that sucka!!!! A lot of people are looking for it.
    I swear I will regress to Slow Leopard just for this one single feature-- and sorry ya'll, I doubt I will be the only person who can't spend all day waiting for drives to back up.

    Okay, what we are griping about is called "recursive copying." There is a Terminal command for it.
    A-and, the Terminal command is in bold if you already know how to do this. Otherwise, here's a primer for command-line interfacing. If you want to learn more about the cp command, type [ man cp ].
    1. Open the Terminal application (in Utilities).
    2. Type this code, which is a basic command for recursive copying ("do not replace" for us non-tech linguists):
    cp -Rpn /originating file path/ /destination file path/
    3. Hit return. If you're moving a large amount of data, say a few gigs or more, at this point the cursor will disappear and the file transfer will take place. The cursor reappears when the operation is done. You can do other things like normal on your computer at this point, but don't move or alter any of the files during the transfer (just like normal). While that cursor is gone there's a transfer going on. If you're curious if it's working (or distrustful like me), you can open a finder window at the destination to watch the files show up.
    If you're wondering if you have to do all that typing, the answer is no. Type in the [ cp -Rpn ] exactly like that and then drag and drop folder 1 into the Terminal window. It'll give you a file path automatically. Then you only need to put a slash after it and then drop the folder you want to copy into onto the the Terminal window. You might have to type another slash. Hit enter.
    Apologies to the person who posted this information on another site or here in the forums. I haven't found your post, but when I do I'll attribute. Many thanks!
    [edited for spelling]

  • 'don't replace' vs 'keep both files'

    How do I get the 'Don't replace' option presented in Snow Leopard and previous vs the 'Keep both files' found in Lion when copying duplicate files to a folder?  I save copies to multiple devices and syncing them is so much slower now that I must choose replace or keep both... I'd love to have the don't replace back to retain my workflow..

    Hi Everyone, I had posted about this in regards to being a photographer with limited CF card space, so I often bring my laptops to upload cards on-the-go. In this fashion it's easy to sometimes shoot on cards that have been partially uploaded or uploaded and then not reformatted and had additional files added. This is a big reason the "don't replace" was of value to me, as I am always worried about accidentally deleting work. (No judgements on my work-flow or style, I just upgraded to a markii so at the largest RAW even a 16GB o ly holds about 400 files and I usually shoot 2500 for an avg 4-6 hour event)
    I did NOTICE recently that a days ted a shoot when I was transferring the last cards, when the finder popped up where it would normally list "don't replace" there were the same options as always, but this time it listed information about a duplicate file that was found. Has anyone else seen this in Lion OS?
    I'm guessing this was the intention, why I didn't see it on other transfers I've done I don't know. But regardless, it only listed ONE file - which given how I shoot, would imply there are many more. So I think of I had hit "skip" it would have gone on to show me the next duplicate. This is still a big error of Lion, because it's just common sense that if this is the updated version of "don't replace" then it should list all the files that are duicates at one time. 
    I plan on writing Apple today about the issue, as was directed in one of the preceding posts. I also an on listing a link to this discussion - it would be GREAT if everyone else grappling with this did likewise, as I'm sure it's likely to have more of an impact.

  • Error 5 occurred at Open/Create/Replace File in Write spreadsheet String.vi

    Hi everyone,
    can anyone help me with this problem?
    "error 5 occurred at Open/Create/Replace File in Write spreadsheet String.vi "
    I've been using this part of the program for over a year an suddenly this error occures. But not always, mainly at the very beginning of my tests when the file should not be open.
    Info: I'm using a realtime PXI-System. Maybe the amount of data can cause the problem? (about 2MB)
    Grüße
    Meike
    Attachments:
    writeResults.jpg ‏345 KB
    error5.jpg ‏52 KB

    Hi Meike,
    is the file opened by a different program? Do you try to access it by FTP in parallel to your VI?
    You could use basic file functions instead of WriteSpreadsheetFile. That way you could open the file before starting the loop, keep it open all the time and close it once you're finished - with the added benefit of easier error handling…
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • MacBool Air / Leopard keep forgetting file preferences.

    Hi,
    My MacBook Air keeps forgetting file preferences. I'm an audio engineer, and so I want my audio files to open in the programs I prefer over iTunes. Also, quicktime can't play most AVIs, yet it tries to open them.
    I know how to set the preferred programs in the info dialog. But as soon as I restart (which I do about once a week) all these settings are gone. This is particularly annoying with iTunes, as it conflicts heavily with my other software, but I can't trash it until I found a good batch convertor.
    I first noticed this forgetfulness after switching on FileVault.
    The question is: How can I make my macbook remember these settings?

    This information is stored/controlled by Launch Services. I would try resetting the LS database and see if that helps.
    Run these commands in Terminal:
    cd /System/Library/Frameworks/ApplicationServices.framework/Frameworks/LaunchServi ces.framework/Support/
    ./lsregister -kill -r -domain local -domain system -domain user
    Hope that helps...
    Message was edited by: petrock

  • During Upgrade - Keep Personal Files Only? or Nothing?

    The help file for Windows 8 Setup says the keep personal files only will keep files under
    \\user\ folder what will happen to folders in the root folder of C:\?.
    Personal files.
    Anything saved in the User folder is considered a personal file, like the Documents and Desktop folders.
    What does it do with the other folders? (Leave, Delete or move to windows.old?)
    If nothing is your choose does this move Root drive files to windows.old?
    Nothing.
    Delete everything and replace your current version with a copy of Windows 8. Your personal files will be moved to a windows.old folder.
    What does it do with the other folders? (Leave, Delete or move to windows.old?)
    Vote for Freedom - Vote to Protect our Country

    Hi,
    Please see “How do I upgrade from Windows 8 Consumer Preview (CP) or Windows 8 Release Preview (RP) to the Released-to-Manufacturing (RTM) version of Windows 8?” in the following thread:
    Windows 8 FAQ
    http://social.technet.microsoft.com/Forums/en-US/w8itprogeneral/thread/7d76e468-192e-4672-8f8e-e78d1446dfaa
    Hope this helps.
    Thanks.
    Nicholas Li
    TechNet Community Support

  • How to keep both file when paste

    hi to  every one
    I would like to know how to keep both files have the same name when I copy one of them to the other folder , since I have tow options only : replace or skip !!!!!!!!!! in windows 8   

    I suspect that that's how it is supposed to be, Cyber_Defend_Team. However, I can confirm that in Windows 8.1, when I attempt to Copy and Paste files, like from my camera's SD card which starts it's numbering system at 0 each time, to my photo folder,
    I only have the following options:
    Replace the file in the destination
    Skip this file
    Compare info for both files
    Now, when I choose the Compare info for both files option, I get a secondary dialogue which shows me a thumbnail of both pictures and has a checkbox for each one in two columns (there is also a checkbox at the top of each column for multiple photos to select
    all in a given column). I'm given only two buttons on this screen, Continue and Cancel. 
    As such, Lany Zhang, I don't think that this question can be considered answered as it isn't. 

  • D7100, .nef files will not open, batch rename naming files differently

    I recently purchased the D7100/Nikon and I am having problems opening the nef files in Bridge and Photoshop CS6 (even after updating – Raw 8.4) and also renaming the files.  Lightroom 4.4, no problem.
    I also tried batch renaming the files, and Bridge is not keeping the .jpg and .nef files consistent as with my old camera (D90). Also, it is creating a new date on the .nef file, rather than keeping it to the day it was shot.
    Old way:
    20140322_LasVegas_0165.jpg
    20140322_LasVegas_0165.nef
    NOW:
    20140322_LasVegas_0165.jpg
    20140413_LasVegas_0166.nef
    I do use the DNG converter to convert the .nef files, and keep all file names consistent (.jpg, .nef, .dng).
    Is something lacking in the updates for Bridge/Photoshop for this camera to view the .nef files?  Is there anything I can do in Bridge to fix the Batch Renaming?  I really do not want to go to each .nef file and rename each one individually.  Help!

    You probably forgot to include the extension .dng or renamed with an extra dot (.) in the filename. Be surr to have only 1 dot with the three letter extension dng at the end (. dng)
    You can use Bridge for that again to rename and use the dng extension

  • Batch Rename Multiple files with different names

    Hi,
    Is there any way to batch rename multiple files with individual names? I.e
    IMG_123 changed to  RSP45AS
    IMG_124 changed to MOL157A
    IMG_125 changed to AGKH135
    IMG_126 changed to MNOLH13
    IMG_127 changed to ASFBLUG
    Etc.
    Are they any programs or scripts or plug ins that would do that job?
    Thanks

    HI there Onemorewave,
    It looks like there is a batch remname feature included in OS X 10.10 Yosimte if you are planing on updating. 
    Rename files, folders, and disks - Mac Help
    Rename multiple items
    Select the items, then Control-click one of them.
    In the shortcut menu, select Rename Items.
    In the pop-up menu below Rename Folder Items, choose to replace text in the names, add text to the names, or change the name format.
    Replace text: Enter the text you want to remove in the Find field, then enter the text you want to add in the “Replace with” field.
    Add text: Enter the text to you want to add in the field, then choose to add the text before or after the current name.
    Format: Choose a name format for the files, then choose to put the index, counter, or date before or after the name. Enter a name in the Custom Format field, then enter the number you want to start with.
    Click Rename.
    Note: To batch rename, you would want to choose the "Format" option.
    -Griff W

  • Batch Rename Raw Files After Import?

    Can you batch rename raw files after you import, so that the file name changes in Aperture and on the hard drive? I want to be able to edit images, and then rename only the keepers. This has been asked before here, but I could not find an answer.
    Thanks!

    File -> Export, Kind: Original
    When you import a Raw to iPhoto it automatically creates a jepg preview of the file. Why? Because you cannot do anything with a Raw: you cannot print it, use it a slideshow and so on. However, with this preview you can work with the photo immediately.
    You can, however, also process the Raw in iPhoto simply by editing it. The Raw processing engine in iPhoto the same one used in Aperture, but with less fine control. (Think of the differences between Word and TextEdit, iMovie and Final Cut). The output from the processing then replaces the preview. You can choose to save your output as either jpeg or tiff in the iPhoto Preferences.
    When you are processing Raw in iPhoto you will see the Raw badge on the bottom of the iPhoto Window
    Uploaded with plasq's Skitch!
    Note: After you have processed a Raw, subsequent edits to the photo are carried out on the processed jpeg (or tiff) not the Raw. If you want to go back to the original then you need to use the Photos -> Reprocess Raw command.
    Aperture works in an entirely different way. What are you trying to do, exactly?
    Regards
    TD

  • I have tried a lot to find an app or some way in email to attach multiple of pdf files in one email. I could not find anything that sends multiple pdf file in one email and still keeping the file in simple pdf format for the recipient.

    I have tried a lot to find an app or some way in email to attach multiple of pdf files in one email. I could not find anything that sends multiple pdf file in one email and still keeping the file in simple pdf format for the recipient.

    I am not aware of a way except for photos that allows you to select multiple files in an email. I even checked settings in the Adobe Reader app, and it does not show that ability.

  • Error 7 occurred at open/create/replace file

    Hello,
    I have searched the forum and could not find any useful information regarding my problem, so hope you may shed some light. MyVI can create a new csv (text) file by using the time to name the file, so every time the new file will be created with a different name and file path is not a relative path. I can run the VI in both development environment and stand along executable without any problem. But, 
    One of my colleagues  cannot run the executable exe on her machine because Error 7 occurred at Open/Create/Replace File in xxxx.vi Possible reason: LabVIEW: File not found. The file might be in a different location or deleted. Use the command prompt or the file explorer to verify that the path is correct.
    My question is why only she cannot run this exe on her machine. I have checked a few different PC in my office and all of them can run this exe without problem, so I am pretty sure the code is fine.
    I have already ask her to do,
    Run the executable as administrator
    Save the new file to other drives (not C: drive)
    but she still cannot run the executable. I dont think this is a premission issue, otherwise, LabVIEW would give a different error, Error 8 I believe.
    Both her PC and my PC is running Windows 7 professional 64-bit. The only difference I can see is that she is based in US and I am based Australia. Does anyone have any idea? Please help.
    Thanks,
    Sherman

    I’m not sure but expecting like below,
    As you said, your creating file name with Time. Make sure file name is correct and there is no special characters (like, / or : ). If your formatting time to string with “Format Date/Time String.vi” (while creating file name), based on UTC format, string will change.
    UTC format specifies if the output string is in Universal Time or in the configured time zone for the computer. If TRUE, date/time string is in Universal Time. The default is FALSE.
    Make sure you have access rights to create files into mentioned folder. Try to create new file manually.
    Munna

  • Error 6 occurred at Open/Creat​e/Replace File in NI_Excel.l​vclass:Sav​e Report to

    I have an application that works on LV60 and when run in LV86 I get the following error:
    Error 6 occurred at Open/Create/Replace File in NI_Excel.lvclassave Report to File.vi->SWF001 Test.vi
    Possible reason(s):
    LabVIEW: Generic file I/O error.
    =========================
    NI-488: I/O operation aborted.
    C:\SWF001 IO Files\1_Single.xls
    The application does:
    New Report.vi
    Excel Get Worksheet.vi
    Excel Easy Table.vi
    Excel Easy Text.vi (4 of them)
    Save Report to File.vi
    Dispose Report.vi
    all in a nice chain (errors and report-in/outs) as is typical
    For some reason I'm getting this error. I'm using it with Excel 2003 SP3 and the spreadsheet contains macros (and I get a prompt "should I enable macros:" (I answer yes), that I didn't get with LV60 and the older version of Excel). This is probably not the problem? but deserves mention.
    The file does exist on the system (and it appears the application is writing to it successfully - though perhaps truncated as the error indicates- i can't tell for sure).
    I can open and save the Excel file independently of LV just fine.
    Any clues?
    Many thanks! -David
    Solved!
    Go to Solution.

    Unfortunately, an Error 6 is a catch all category for all sorts of file IO errors that LV doesn't know how to handle. For example, while it doesn't sound like your problem, trying to access a file that resides on a network drive that isn't currently mounted can generate an Error 6.
    Have you tried saving the file to a different location?
    If you restart your computer and run the VI does it generate the error the very first time you run it?
    Can you post your code - or at least a subset of it that demonstrates the problem?
    Is Excel open when you are running the code?
    Also, as a test try modifying your code so it has a unique name every time you save it.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Error 7 occurred at Open/Creat​e/Replace File in Open Config Data.vi

    I have a .vi that was working fine with Labview 7.0.  I now have upgraded to Labview Professional 8.0, and I am trying to build a stand alone  executable.  When I build the executable, build an installer, and then try to install it on another computer then run it......... I get the "Error 7 occurred at Open/Create/Replace File in Open Config Data.vi" error.  Any ideas?

    Hello,
    In addition to the LabVIEW Help, there is an Application Note on Distributing Applications with the LabVIEW Application Builder and a knowledge base article What Is The Build Specification Feature In Application Builder? that might be helpful.
    Also, here
    is a knowledge base article on what Dennis has described and it
    provides an example to call an extra Strip Path function. Also, instead
    of using a Match Pattern function, you could use the App.Kind property
    node (use Open Application Reference, Property Node: Application ->
    Kind, and Close Reference) to determine if you are running in a
    Run-time system.
    Good luck and best regards,
    Shakhina P.
    Applications Engineer
    National Instruments

  • Batch convert Pages files to Doc and stay in the same folder?

    Hi there,
    I use iWork '09 on Mountain Lion. I recently switched to Microsoft Word and prefer it over Pages (personal preference). However, I have nearly 1000 files on my computer that are in Pages format. I have extensively searched this issue in the Apple Support Communities and it appears that there are scripts that DO EXIST that batch convert Pages files into Word files. However, it appears that many of these scripts were built for older versions of iWork and therefore I run into various errors. For example, I used the script available at http://pagesfaq.blogspot.com/2008/01/export-folder-to-word-rtf-pdf-txt-or.html and click run but nothing actually happens (the script runs for less than a second, then I can click run again). I was able to use one script successfully (pasted below), but the only reason I can't use it is because it saves ALL my converted documents in one folder on my desktop and I would like a script that can save them in the original file were the Pages document is located.
    So, is there an iWork '09 compatible script that can convert my Pages documents to Word documents and save them in the same folder as the original? Oh, and for an added bonus, it'd be cool if the script also deleted my Pages version after it was done with the conversion
    --[SCRIPT batch_exportPages2DOC] (* Enregistrer ce script en tant que script ou progiciel. Exécuter ce script ou déposer l'icône d'un dossier sur son icône. Il ouvre tout document Pages du dossier et l' enregistre en fichier DOC  dans le dossier "was_Pages_now_DOC". Celui-ci peut être sur le bureau ou dans le dossier "~/Documents". Si le GUIscripting n'est pas activé le script demande votre mot de passe pour l'activer. Le script récupère le dossier d'exportation par défaut dans le fichier de préférences de Pages. Éviter de cliquer durant l'exécution du script sauf évidemment pour sélectionner le dossier source. ************* Save the script as script or application bundle. Run it or drag and drop a folder icon on its icon. It opens every Pages's documents stored in the folder and save it as DOC file in a folder named "was_Pages_now_DOC". This one may be on the desktop or in the "~/Documents" folder. according to the property storeOnDesktop. If GUIscripting is disabled the script ask for your password to enable it. The script extract the default export path from the Pages's preferences file. Don't click when the script is running. Except, of course, to select the source folder. ************* Yvan KOENIG (VALLAURIS, France) 2008/04/20 2009/06/17 adapté pour format .doc 2009/12/13 updated for MacOs 10.6… *) property theApp : "Pages" property theExt : "pages" property nomDuRapport : "report_Pages2DOC.txt" property nom_du_dossier : "was_Pages_now_DOC" property storeOnDesktop : true (* true = dest folder will be on Desktop false = dest folder will be in "~/Documents" *) property msg1 : "" -- globale property msg90 : "" -- globale property msg91 : "" -- globale -- property msg92 : "" -- globale property msg94 : "" -- globale property msg96 : "" -- globale property msg99 : "" -- globale property rapport : "" -- globale property dossierDeStockage : "" -- globale property dossierParDefaut : "" -- globale property localExport : "" -- globale property newExt : "" -- globale property newType : "" -- globale property isOs4 : missing value -- globale property isOs5 : missing value -- globale property theMenu : missing value -- globale property menuExport : missing value -- globale property types : {{"doc", "SLDocumentTypeMSWord", 2}, {"pdf", "SLDocumentTypePDF", 1}, {"txt", "SLDocumentTypePlainText", 4}, {"rtf", "SLDocumentTypeRichText", 3}, {"rtfd", "SLDocumentTypeRichTextBundle"}, 3} --===== (* our settings *) property typeNum : 1 (* 1 = WORD, 2 = PDF, 3 = Txt, 4 = rtf, 5 = rtfd *) property theButton : missing value (* 1          button PDF 2          button Word 3          button RTF 4 button Standard *) --===== on run (* lignes exécutées si on double clique sur l'icône du script application • lines executed if one double click the application script's icon *)             tell application "System Events" to set dossier to choose folder (* dans un bloc System Events pour avoir un titre de dialogue "localisé" • in a System Events block to get a localized dialog title. *)           my commun({dossier})             --          my commun({"Macintosh HD:Users:yvan_koenig:Desktop:for_see:" as alias}) end run --===== on open (sel) (* sel contient une liste d'alias des éléments qu'on a déposés sur l'icône du script (la sélection) • sel contains a list of aliases of the items dropped on the script's icon (the selection) *)           my commun(sel) end open --===== on commun(elems)           my nettoie()           my prepareMessages()             tell application "System Events"                     if not (UI elements enabled) then set (UI elements enabled) to true (* Active le GUI scripting • Enable GUI scripting *)                     set titres to title of processes           end tell -- to System Events             if theApp is not in titres then my activateTheApp() (* Active et ferme la fenêtre du document créé à l'ouverture • Activate and close the doc's window created at opening *)           set {newExt, newType, theButton} to item typeNum of types (* item 1 = {"doc", "SLDocumentTypeMSWord",2} item 2 = {"pdf", "SLDocumentTypePDF",1} item 3 = {"txt", "SLDocumentTypePlainText",4} item 4 = {"rtf", "SLDocumentTypeRichText",3} item 5 = {"rtfd", "SLDocumentTypeRichTextBundle",3} *)           set sysAtt to (system attribute "sys2")           if 4 > sysAtt then                     if my parleAnglais() then                               error "This script requires MacOs X 10.4 or higher !"                     else                               error "Ce script requiert MacOs X 1.4 ou ultérieur !"                     end if           else if 5 > sysAtt then                     set isOs4 to true                     set isOs5 to false                     if my getVersion() < "4" then                               set theMenu to 3                               set menuExport to 13                     else                               set theMenu to 10                               set menuExport to 9                     end if           else if 6 > sysAtt then                     set isOs4 to false                     set isOs5 to true                     if my getVersion() < "4" then                               set theMenu to 3                               set menuExport to 13                     else                               set theMenu to 10                               set menuExport to 8 (* was a wrong 9 *)                     end if           else                     set isOs4 to false                     set isOs5 to false                     if my getVersion() < "4" then                               set theMenu to 3                               set menuExport to 13                     else                               set theMenu to 10                               set menuExport to 8 (* was a wrong 9 *)                     end if           end if           my fermeFenetres() (* • Close existing windows *)             my afficheLeMessage(msg1) (* Éviter de cliquer… • Don't click… *)           tell application theApp to set localExport to localized string "Export"           set dossierParDefaut to my getDefaultExport() as text           set rapport to ""           set dossierDeStockage to my creeDossierDeStockage(nom_du_dossier) (* Unicode text *)             try                     repeat with elem in elems                               try                                         my exploreTraite(elem as alias, "")                               end try                     end repeat                       if rapport = "" then set rapport to msg90                     -- crée un fichier texte sur le Bureau                     set p2d to path to desktop                     set p2r to (p2d as Unicode text) & nomDuRapport                     tell application "System Events"                               if exists (file p2r) then delete (file p2r)                               make new file at end of p2d with properties {name:nomDuRapport}                     end tell                     set rapport to rapport as text                     write rapport to (p2r as alias)             on error MsgErr number NroErr                     if NroErr is not -128 then                               beep 2                               tell application (path to frontmost application as string) to ¬                                         display dialog "" & NroErr & " : " & MsgErr with icon 0 buttons {msg99} giving up after 20                     end if -- NroErr is…                     return           end try             my nettoie()           if my parleAnglais() then                     my afficheLeMessage("Export done.")           else                     my afficheLeMessage("Traitement terminé.")           end if end commun --===== on nettoie() (* pour ne pas stocker dans le fichier script • So it will not be stored in the script file *)           set dossierDeStockage to ""           set dossierParDefaut to ""           set rapport to ""             set localExport to ""           set newExt to ""           set newType to ""           set isOs4 to missing value           set isOs5 to missing value           set theMenu to missing value           set menuExport to missing value           set theButton to missing value           set msg1 to ""           set msg90 to ""           set msg91 to ""           set msg92 to ""           --           set msg94 to ""           set msg96 to ""           set msg99 to " " end nettoie --=====  on afficheLeMessage(m)           beep 1           tell application (path to frontmost application as string)                     activate                     if my parleAnglais() then                               display dialog m buttons {" OK "} default button 1 giving up after 10                     else                               display dialog m buttons {" Vu "} default button 1 giving up after 10                     end if           end tell end afficheLeMessage --===== on creeDossierDeStockage(Nom) (* S'il n'existe pas, construit un dossier destination sur le bureau ou dans "~/Documents" • If does not exist, create a destination folder on the desktop or in "~/Documents" *)           local dd, dds           if storeOnDesktop is true then                     set dd to path to desktop as Unicode text           else                     set dd to path to documents folder as Unicode text           end if             if Nom ends with ":" then                     set dds to dd & Nom           else                     set dds to dd & Nom & ":"           end if           (* dossierDeStockage n'existe pas, on le crée • dossierDeStockage is not available, build it *)           tell application "System Events" to if not (exists item dds) then make new folder at end of folder dd with properties {name:Nom}           return dds as Unicode text end creeDossierDeStockage --===== on exploreTraite(elem, ptree) (* elem est un alias • elem is an alias *)           local elem_, cl_, type_Id           set elem_ to elem as Unicode text           tell application "System Events" to tell disk item elem_                     set cl_ to class                     if cl_ is folder then                               set type_Id to ""                     else                               set type_Id to type identifier                     end if           end tell --  "System Events"           set cl_ to cl_ as Unicode text             if type_Id is in {"com.apple.iwork.pages.pages", "com.apple.iwork.pages.sffpages"} then (* C'est un fichier Pages. • It's a Pages document *)                     my TraiteUnDocument(elem_)           else if cl_ is in {"file package", "«class cpkg»"} then                     set rapport to rapport & msg91 & elem_ & return (* "Package", Attention, un package EST un dossier "spécial". • Caution, a package IS a "special" folder. *)           else if cl_ is in {"folder", "«class cfol»"} then                     my ExploreUnDossier(elem_, ptree)           else                     set rapport to rapport & msg92 & elem_ & return (*  "Pas un document Pages". • "Not a Pages's document" *)           end if -- typeId_ is … end exploreTraite --===== on ExploreUnDossier(dossier, ptree)           local nomElement, cheminElement, c           repeat with nomElement in list folder dossier without invisibles                     set cheminElement to dossier & nomElement                     tell application "System Events" to set c to name of (dossier as alias)                     my exploreTraite(cheminElement as alias, ptree & c & ":")           end repeat end ExploreUnDossier --===== on TraiteUnDocument(leCheminOriginal_UniText)           my export2Doc(leCheminOriginal_UniText as alias, leCheminOriginal_UniText) end TraiteUnDocument --===== on export2Doc(p, leCheminOriginal_UniText) (* • here p is the path as alias *)           local flag, nom_de_p, nouveauChemin, w, bof, x, p_xport           try                     tell application theApp                               open p                               set flag to false                               repeat 300 times (* Attends que le fichier soit réellement ouvert. • Wait until the file is really open *)                                         if my getNbWindows() > 0 then                                                   set flag to true                                                   exit repeat                                         end if                               end repeat                     end tell -- to theApp                     if flag is false then error number 8888 (* Le fichier n'a pu être ouvert. • The file can't be open. *)           on error MsgErr number NroErr                     if NroErr = 8888 then                               set rapport to rapport & msg94 & leCheminOriginal_UniText & return                     else                               set rapport to rapport & "### " & MsgErr & " ### " & errNbr & return                     end if                     return (* can't do the remaining tasks *)           end try             tell application "System Events" to tell file leCheminOriginal_UniText                     set nom_de_p to name           end tell -- System Events             if nom_de_p ends with theExt then set nom_de_p to text 1 thru -(2 + (length of theExt)) of nom_de_p           set nouveauChemin to dossierParDefaut & nom_de_p & "." & newExt           --log nouveauChemin           tell application "System Events" to if exists (file nouveauChemin) then set name of file nouveauChemin to nom_de_p & my horoDateur(modification date of file nouveauChemin) & "." & newExt (* name stamped *)           try                     set {w, bof} to my getFrontWindow()                       tell application "System Events" to tell application process theApp                               click menu item menuExport of menu 1 of menu bar item theMenu of menu bar 1 (* Exporter… *)                               repeat until exists sheet 1 of window w                                         delay 0.1                               end repeat                               tell sheet 1 of window w (* sheet containing the buttons PDF, Word, RTF, Standard *)                                         --          get properties of UI elements of radio group 1                                         if isOs4 then                                                   click button theButton of radio group 1                                         else if isOs5 then                                                   click checkbox theButton of radio group 1                                         else                                                   click radio button theButton of radio group 1 (* I hope that they will no longer change it *)                                         end if -- isOs4 is true                                         (*                                         if typeNum is 2 then                                                   delay 0.2                                                   tell pop up button 1                                                             click                                                             click menu item quality of menu 1                                                   end tell                                                   delay 0.2                                         end if                                         *)                                         click button 1 (* Suivant… *)                                         repeat until exists button localExport                                                   delay 0.1                                         end repeat                                         click button localExport (* Exporter… *)                               end tell -- to sheet…                                 repeat 20 times                                         if exists sheet 1 of window w then                                                   click button 2 of sheet 1 of window w (* "Ne pas consulter " dans éventuel rapport d'anomalies • "Don't review" in sheet reporting possible export anomalies *)                                                   exit repeat                                         end if                                         delay 0.1                               end repeat                     end tell -- to process … System Events                       if dossierDeStockage is not dossierParDefaut then (* we must move the file from folder dossierParDefaut to folder dossierDeStockage *)                                 set p_xport to dossierDeStockage & nom_de_p & "." & newExt                                 tell application "System Events" to if exists (file p_xport) then set name of file p_xport to nom_de_p & my horoDateur(modification date of file p_xport) & "." & newExt                               tell application "Finder" to duplicate file nouveauChemin to folder dossierDeStockage (*                               • before 10.5, System Events is unable to move *)                                 my wait4File(p_xport)                                 tell application "System Events" to if exists file nouveauChemin then delete file nouveauChemin                     end if -- dossierDeStockage is not…                     my ferme1fenetre()             on error errMsg number errNbr                     set rapport to rapport & msg96 & p & return & errMsg & " ### " & errNbr & return           end try end export2Doc (* ===== • Build a stamp from the modification date_time *) on horoDateur(dt)           local annee, mois, jour, lHeure, lesSecondes, lesMinutes           set annee to year of dt           set mois to month of dt as number (* existe depuis 10.4 *)           set jour to day of dt           set lHeure to time of dt           set lesSecondes to (lHeure mod 60)           set lHeure to round (lHeure div 60)           set lesMinutes to (lHeure mod 60)           set lHeure to round (lHeure div 60)           return "_" & annee & text -2 thru -1 of ("00" & mois) & text -2 thru -1 of ("00" & jour) & "-" & text -2 thru -1 of ("00" & lHeure) & text -2 thru -1 of ("00" & lesMinutes) & text -2 thru -1 of ("00" & lesSecondes) (* • Here, the stamp is  "_YYYYMMDD-hhmmss" *) end horoDateur (* ===== • Take care, the front window may be an Inspector or a dialog one. *) on getFrontWindow()           local namesOfWindows, w, flag           tell application theApp to activate           set flag to false           tell application "System Events" to tell application process theApp                     set namesOfWindows to name of every window                     repeat with w in namesOfWindows                               if subrole of (get properties of window w) is "AXStandardWindow" then                                         set flag to true                                         exit repeat                               end if                     end repeat           end tell           return {w, flag} (* • w is the name of the front document's window *) end getFrontWindow (* ===== • Wait that the file is completely written on disk *) on wait4File(p) (* • p must be Unicode text *)           local oldSize, nnn, newSize           set oldSize to 0           tell application "System Events" to set nnn to name of file p             repeat                     try                               tell application "System Events" to set newSize to physical size of file p                               if oldSize < newSize then                                         set oldSize to newSize                               else                                         exit repeat                               end if                     end try           end repeat end wait4File --===== on activateTheApp()           local bof, status           tell application theApp to activate           if my getStartingStatus() is false then tell application "System Events" to tell application process theApp to keystroke return           repeat                     set {bof, status} to my getFrontWindow()                     if status is true then exit repeat           end repeat end activateTheApp (* ===== • Close existing open windows *) on fermeFenetres()           repeat while my getNbWindows() > 0                     my ferme1fenetre()           end repeat (* • Now there is no open window *) end fermeFenetres --===== on ferme1fenetre()           tell application theApp to activate           tell application "System Events" to tell application process theApp to keystroke "w" using {command down} end ferme1fenetre --===== on getPlistValue(valName, default)           local thePlist, u           set thePlist to (path to preferences folder as Unicode text) & "com.apple.iWork." & theApp & ".plist"           tell application "System Events"                     if exists file thePlist then                               tell contents of property list file thePlist                                         try                                                   set u to (value of property list item valName) (* Unicode Text *)                                         on error (* On est là si Pages n'a rien enregistré avec des préférences neuves • Here if Pages never saved with the new preferences file. *)                                                   set u to default                                         end try                               end tell -- to contents of…                     else (* On est là s'il n'y a pas de fichier de préférences • Here if there is no preferences file. *)                               set u to default                     end if           end tell -- to system events           return u end getPlistValue --===== on getStartingStatus()           return my getPlistValue("LSDefaultsUseDefaultStartingPoint", false) end getStartingStatus --===== on getDefaultExport()           local u           (* son of a *****, I forgot that they don't use the same name !! *)           if theApp contains "Pages" then                     set u to my getPlistValue("SLDocumentDefaultExportDirectory", "~/Documents")           else if theApp contains "Numbers" then                     set u to my getPlistValue("LSDocumentDefaultExportDirectory", "~/Documents")           else                     error "I didn't coded a Keynote version !"           end if             set u to (POSIX file (do shell script "echo " & u)) as text           if u ends with ":" then                     return u           else                     return (u & ":")           end if end getDefaultExport --===== on getNbWindows()           tell application "System Events" to tell application process theApp to return count of windows end getNbWindows --===== on getLocale(a, x)           tell application a to return localized string x end getLocale --===== on getVersion()           try                     tell application theApp to return version           on error                     return "1"           end try end getVersion --===== on parleAnglais()           local z           try                     tell application theApp to set z to localized string "Cancel"           on error                     set z to "Cancel"           end try           return (z is not "Annuler") end parleAnglais --===== on prepareMessages()           if my parleAnglais() then                     set msg1 to "Don’t click when the script is running." & return & "Except, of course, if it ask for."                     set msg90 to "No problem during the export process."                     set msg91 to "Package"                     set msg92 to "Not a " & theApp & "’s document"                     --                     set msg94 to theApp & " can’t read it"                     set msg96 to "Not copied."                     set msg99 to "Oops"           else                     set msg1 to "Éviter de cliquer durant l’exécution du script" & return & "sauf s’il le demande."                     set msg90 to "Exportation réussie sans incident."                     set msg91 to "Package"                     set msg92 to "Pas un document " & theApp                     --                     set msg94 to theApp & " n’a pas pu le lire"                     set msg96 to "Pas copié."                     set msg99 to " Vu "           end if           set msg91 to "### " & msg91 & " ###  "           set msg92 to "### " & msg92 & " ###  "           --           set msg94 to "### " & msg94 & " ###  "           set msg96 to "### " & msg96 & " ###  " end prepareMessages --===== --[/SCRIPT]

    Try this app: http://tyorex.com/iWorkConverter
    Batch convert Pages files to doc and pdf.

Maybe you are looking for

  • Communication between Computer and Projector

    What commands can I use to have a communication between a computer and a projector? (If I connect those with a VGA wire). Thanks

  • How do I view Safari in Full screen?

    I am new to Mac and cant seem to find a way to view Safari and other applications in full screen - is this possible?

  • SAP - MS Word 2000 (missing form fields)

    Hi, I designed a report to download quality notification data into MS Word. I use MS Word 2003 on my laptop. The users have MS Word 2000. Steps that I followed : 1. Create a template using program SAPRDEMO_FORM_INTERFACE 2. Save the template on your

  • QuickTime not playing Flash

    QuickTime isn't handling Flash, getting the icon with ? on all sites I try. Also notice that swf no longer appears as a Mime type setting in QT Preferences ... Leopard seems to think that 'Device Central' should be handling them but that's throwing a

  • Use iPad as MacBook display?

    I have an '07 MacBook that took an unfortunate tumble and destroyed all but one corner of the screen. I was going to replace it over the summer with a Desktop and an iPad, but I don't want to get the Desktop now as I'm moving soon. So what I'm wonder