Stringsa and numbers in a same file?

Hello
I have different numeriques data to write in a report file and wonder
whether it's possible to include in the beginning of the file, the date and
hour, those data were taken.
I'm sure it's possible but I don't find the right vi to both include a
string data, namely date and hour and numbers.
Thanks for your help
gérard
Gérard Férini
Switzerland
http://home.tiscalinet.ch/gferini/Main_Photos.html

Hi Gérard,
Here's a solution to what you want to do but I'm not really sure that's what you're looking for, is it ?
Hope this helps anyway !
Julien
Attachments:
Write_date_to_file.jpg ‏15 KB

Similar Messages

  • I need to make Landscape and portrait in the same file ? plz I don't want to go back to word

    Hi there I am trying to have page in landscape and portrait in the same file, but I couldn't, however, if there is a way where we can perform it please advise me as I need to do that for my thesis. Am happy to work only in pages if this feature is not in pages, please find us a solution.
    Regards
    Mohammed

    Export te document to PDf. Open it in Preview. Here you can rotate the a page to horisontal.

  • How to read from and write into the same file from multiple threads?

    I need to read from and write into a same file multiple threads.
    How can we do that without any data contamination.
    Can u please provide coding for this type of task.
    Thanks in advance.

    Assuming you are using RandomAccessFile, you can use the locking functionality in the Java NIO library to lock sections of a file that you are reading/writing from each thread (or process).
    If you can't use NIO, and all your threads are in the same application, you can create your own in-process locking mechanism that each thread uses prior to accessing the file. That would take some development, and the OS already has the capability, so using NIO is the best way to go if you can use JDK 1.4 or higher.
    - K
    I need to read from and write into a same file
    multiple threads.
    How can we do that without any data contamination.
    Can u please provide coding for this type of task.
    Thanks in advance.

  • How to delete and edit particular line in a file and save it in same file ?

    Hi,
    I want to delete and edit text at particular line in a file.
    But edit and delete should reflect in same file.
    I have done googling for this but it results with using another file, that i dont want as i need to save changes in same file.
    How can i do this?
    Thanks in advance
    Edited by: vj_victor on May 24, 2010 3:33 PM

    I just want to make sure, this is the only way to do what i mentioned ? or it could be done another way !a) write the data to a new file
    b) delete the old file
    c) write the data to a newer file
    d) delete the new file
    e) rename the newer file to the old file name.
    For a hint about still more ways to do this, search for the complete lyrics of One man went to mow, Went to mow a meadow...
    db

  • How to read the data file and write into the same file without a temp table

    Hi,
    I have a requirement as below:
    We are running lockbox process for several business, but for a few businesses we have requirement where in we receive a flat file in different format other than how the transmission format is defined.
    This is a 10.7 to 11.10 migration. In 10.7 the users are using a custom table into which they are first loading the raw data and writing a pl/sql validation on that and loading it into a new flat file and then running the lockbox process.
    But in 11.10 we want to restrict using temp table how can we achieve this.
    Can we read the file first and then do validations accordingly and then write to the same file and process the lockbox.
    Any inputs are highly appreciated.
    Thanks & Regards,
    Lakshmi Kalyan Vara Prasad.

    Hello Gurus,
    Let me tell you about my requirement clearly with an example.
    Problem:
    i am receiving a dat file from bank in below format
    105A371273020563007 07030415509174REF3178503 001367423860020015E129045
    in this detail 1 record starting from 38th character to next 15 characters is merchant reference number
    REF3178503 --- REF denotes it as Sales Order
    ACC denotes it as Customer No
    INV denotes it as Transaction Number
    based on this 15 characters......my validation comes.
    If i see REF i need to pick that complete record and then fill that record with the SO details as per my system and then submit the file for lockbox processing.
    In 10.7 they created a temporary table into which they are loading the data using a control file....once the data is loaded into the temporary table then they are doing a validation and updating the record exactly as required and then creating one another file and then submitting the file for lockbox processing.
    Where as in 11.10 they want to bypass these temporary tables and writing it into a different file.
    Can this be handled by writing a pl/sql procedure ??
    My findings:
    May be i am wrong.......but i think .......if we first get the data into ar_payments_interface_all table and then do the validations and then complete the lockbox process may help.
    Any suggestions from Oracle GURUS is highly appreciated.
    Thanks & Regards,
    Lakshmi Kalyan Vara Prasad.

  • Why can't I open ccitt g4 compression tiff files with ps6? and could open theses same files with ps3?

    Why can't I open CCITT G4 compression , TIFF format files with PS6?  I used to open these same files with PS3.   Can anyone help me out with this????

    This is what I get when trying to open ccitt G4 compression files. Tiff format.   Thanks for trying to answer my question and Problem.  I found a site where supposedly I can download a plug in into photoshop 6 that will open the files.  don't know if it will work but am gonna try it.

  • How can I do to acquire and save date in the same time and in the same file when I run continual my VI without interrupti​on.

    I've attached a VI that I am using to acquire amplitude from Spectrum analyzerse. I tried to connect amplitude ouput to the VI Write Characters To File.vi and Write to Spreadsheet File.vi. Unfortunately when I run continual this VI without interruption, labview ask me many time to enter a new file name to save a new value.
    So, How can I do to aquire and save date in the same time and in the same file when I run continual my VI for example during 10 min.
    Thank you in advance.
    Regards,
    Attachments:
    HP8563E_Query_Amplitude.vi ‏37 KB

    Hi,
    Your VI does work perfectly. Unfortunately this not what I want to do. I've made error in my last comment. I am so sorry for this.
    So I explain to you again what I want to do exactly. I want to acquire amplitude along road by my vehicle. I want to use wheel signal coming from vehicle to measure distance along road. Then I acquire 1 amplitude each 60 inches from spectrum analyzer.
    I acquire from PC parallel port a coded wheel signal coming from vehicle (each period of the signal corresponds to 12 Inches). Figure attached shows the numeric signal coming from vehicle, and the corresponding values “120” and “88” that I can read from In Port vi.
    So I want to acquire 1 time amplitude from spectrum analyser each 5
    period of the signal that I am acquiring from parallel port.
    So fist I have to find how can I count the number of period from reading the values “120” and “88” that I am acquiring from In Port (I don’t know the way to count a number of period from reading values “120” and “88”).
    Here is a new algorithm.
    1) i=0 (counter: number of period)
    2) I read value from In Port
    3) If I acquire a period
    i= i+1 (another period)
    4) If i is multiple of 5 (If I read 5 period)
    acquire 1 time amplitude and write to the same
    file this amplitude and the corresponding distance
    Distance = 12*i). Remember each period of signal
    Corresponds to 12 Inches).i has to take these
    values: 5,10,15,20,25,35,40,45,50,55,60............
    5) Back to 2 if not stop.
    Thank you very much for helping me.
    Regards,
    Attachments:
    Acquire_Amplitude_00.vi ‏59 KB
    Figure_Algorithm.doc ‏26 KB

  • Dbms_lob.fileopen gives ORA-22288. Can open the same file with utl_file.

    What could cause the following behaviour:
    Database 11gR2
    declare
       l_amt        number := dbms_lob.lobmaxsize;
       l_dst_loc    clob;
       l_dst_offset number := 1;
       l_lang_ctx   number := dbms_lob.default_lang_ctx;
       l_src_loc    bfile;
       l_src_offset number := 1;
       l_warning    number;
    begin
       l_src_loc := bfilename('ODS_SERVER_DIRECTORY', '_CIVKD_ASU.CSV');
       dbms_lob.createtemporary(l_dst_loc, true);
       dbms_lob.fileopen(l_src_loc, dbms_lob.file_readonly);
       dbms_lob.loadclobfromfile(l_dst_loc
                                ,l_src_loc
                                ,l_amt
                                ,l_dst_offset
                                ,l_src_offset
                                ,dbms_lob.default_csid
                                ,l_lang_ctx
                                ,l_warning);
       commit;
       dbms_lob.fileclose(l_src_loc);
       dbms_output.put_line(substr(l_dst_loc, 1, 200));
    end;
    ORA-22288: file or LOB operation FILEOPEN failed
    ORA-06512: in "SYS.DBMS_LOB", line 805
    ORA-06512: in line 31
    22288. 00000 -  "file or LOB operation %s failed\n%s"
    *Cause:    The operation attempted on the file or LOB failed.
    *Action:   See the next error message in the error stack for more detailed
               information.  Also, verify that the file or LOB exists and that
               the necessary privileges are set for the specified operation. If
               the error still persists, report the error to the DBA.However opening and reading the exact same file succeeds when using utl_file.
    declare
       l_file utl_file.file_type;
       l_regel varchar2(4000);
    begin
       l_file := utl_file.fopen('ODS_SERVER_DIRECTORY', '_CIVKD_ASU.CSV', 'R');
       -- Haal de volgende regel op
       utl_file.get_line(l_file, l_regel);
       dbms_output.put_line(l_regel);
       utl_file.fclose_all;
    end;So it seems the file is available and accessable by the database.
    It's the first time we run into this particular error and it's one of the first 11gR2 instances so maybe there is something 11g specific we don't know about?

    Some progress made. It turns out the directory object points to a shared drive. It's a windows server and Oracle runs as Local System. I always thought that it was impossible to read anything from a shared drive in this situation. Apparently in some situations you can using utl_file but not usign dbms_lob.

  • Encrypt/decrypt same file with two different passwords

    Hi everyone:
    I'm quite new to Java and cryptography in general and have a theoretical question. Is the following scenario possible and how would it be implemented:
    Two users with two passwords (say, a regular user and a superuser) encrypt, decrypt, read from and write to the same file. The secret key for encryption and decryption should be based on their passwords (generated from their passwords), i.e. not stored anywhere on the system.
    I've been racking my brains but can't think of a way. Am I missing an obvious solution?
    Can it be done?
    Thanks,
    Michael

    I don't think you can avoid having more than just a password hash stored on the system. Using a combination of my approach and Jeff's approach I can implement this as long as you allow a password protected key store to be stored on each system. A given user's key store would contain his RSA private key and associated public key together with the admin user's RSA certificate (thought the admin user's public key could be stored in the program since it does not have to be kept private). The admin user's key store would contain only his RSA private and public keys.
    Assume that the data file is to be create by a standard non-admin user. His code performs the following actions -
    1) Generates a random symmetric algorithm key. Say a 128 bit AES key.
    2) He write a digest of this to the output file.
    3) He writes the random key encrypted with his public key to the file.
    4) He writes his public key (or certificate) to the file.
    5) He writes the random key encrypted with the admin users public key to the file.
    6) He encrypts the data using the random key writes the result to the file.
    This user can then update the file by
    1) reading from the file the digest of the random key.
    2) reading the random key encrypted with his public key.
    3) Decrypting this encrypted random key using his private key extracted from his keystore.
    4) Check the digest of this key to make sure he has the correct random key.
    5) skipping his certificate and the random key encrypted using the admin user's public key.
    5) Decrypting the data using the random key.
    6) Update the data.
    7) Re-encrypt the file as described in the first part using a new random key.
    The admin user can
    1) read from the file the digest of the random key.
    2) skip the random key encrypted using the user's public key.
    3) reading the user's public key from the file (for use later if the file needs to be updated).
    4) read the random key encrypted using the admin's public key.
    5) decrypting the random key using the admin's private key obtained from his key store.
    6) check the digest of the random key to make sure it is correct.
    7) decrypt the the data.
    The admin can edit the data since he can re-encrypt the data in a similar manner to the way it was created in the first place.

  • Stoping people working on the same file on RAID

    Is there anyway to stop or warn two people that accidentally open and work on the same file on a Xserve RAID. Some applications like Quark and Word have this feature built in. If I open and work on a Freehand MX or Photoshop CS file there is no warning to say that someone may also have this file open. Obviously the last save by either party will overstrike the other person work.
    Many thanks
    Andy

    The Xserve RAID is connected to a Xserve via Apple Fibre Channel card, which is connected to a AIT-3 tape library for backup. This is all running off of a APC smart UPS. The studio workstations are connected via gigabit copper switch. I share the RAID via AFP, but it does not seem to have any options in the sharing section of workgroup manager to enable locking of files when they are open. Two people had the same Freehand MXa file open and were both working on the file independently, one must have saved closed the file down and the other person carried on working. Of the course the first person opened the file again and was shocked to see it was totally different to how he had left it.
    I'm running Panther server and most of the studio workstations are still on panther. I'm aware that Freehand MXa is a carbonized application therefore it has not been natively written for MAC OS X.
    Hope I have explained myself and it makes some sort of sense.
    Many thanks
    Andy

  • Is there any way i can keep pages documents and numbers documents in the same file?

    Im trying to group pages and numbers documents in the same file is this possible?

    Not on the iPad itself, no. iOS apps keep their documents within each app itself. You would need to save the documents to a WebDAV server. Dropbox can serve this function if partnered with DropDAV. See:
    http://techinch.com/blog/integrate-dropbox-with-pages-keynote-and-numbers-on-ipa d
    Regards.

  • Reading and Writing from a text file at the same time

    I know who to use the Scanner and PrintWriter to read from and write to a .txt file. But these are limited. How can I read and write at the same time? Such as open a file and change every third character or change every second word to something else and then write it back. I found this [http://java.sun.com/docs/books/tutorial/essential/io/|http://java.sun.com/docs/books/tutorial/essential/io/] but its a little over my head. Is this the only way to do it?

    wrote:
    You are using buffered reads and writes I would assume, right? Also, how do you think most programs handle this sort of thing? I don't believe I'm using buffering.
    My code looks something like this
    //...necessary imports
    //then
    Scanner inFile = new Scanner (new file("filename1.txt"));
    PrintWriter outFile = new PrintWriter ("filename2.txt");
    //then stuff like
    int x = inFile.hasNextInt();
    outFile.println(x);
    camickr wrote:If you are changing the data "in place", that is none of the data in the file is shifted, then you can use a RandomAccessFile.
    Otherwise, you've been given the answer above.What is RandomAccessFile? Is it what I have a link to? Basically what I do is I write a bunch of numbers to a txt file and then change the numbers I don't need anymore to 0. So say I had 0 1 2 3 4 5 6 7 etc. I would like to to open the txt file and change every second one to 0 so then I'd have only odd numbers and 0s.
    I looked at the documentation for RandomAccessFile and it seems like it might be what I need.
    Thankyou both for your help so far. I took a java course in high school and they only taught me one way to get data from text files and that is what I just showed you. So maybe this questions are really stupid. lol
    Edited by: qw3n on Jun 13, 2009 7:46 PM

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

  • IWork export to Office error "The file format is invalid" in pages, keynote and numbers.

    I am running iWork 09 (latest versions in all cases)*. When I try to export files from all three of the applications Pages, Keynote and Numbers into the relevant Office formats, I get the error "The file format is invalid." It works fine with PDF or RTF export.
    I am able to open the same files in the iPad versions of thess iWork apps, and then export them. While this workaround will do for now, I'd like to be able to just export correctly.
    Anyone have any suggestions on what might be wrong?
    Thanks,
    Iarla
    * on a MacBook Pro '07, running Lion 10.7.1.

    Yes, this worked a treat, thanks very much! *
    Iarla
    * Note that I needed to manually remove iWorks as the For_iWork:iWork '09:iWork9Update5.dmg.zip file wouldn't work on the latest version of iWorks. This involved deleting the iWork folders in the Applications and Library directories.

  • 2 SD cards with the same file numbers

    How do I burn 2 SD cards with the same file numbers. Always says do I want to replace photo with the same number.

    Welcome to the Apple Discussions. Rename one set of photos by renaming them in iPhoto with the Photos ➙ Batch Change ➙ Title to Text menu option and then export to the Desktop with the option to use the Title as the new file name.
    Or, put one each set of photos in their own folder and put the two folders on the memory card.
    Happy Holidays

Maybe you are looking for