Converting Word 5.1 files with Applescript

As Microsoft office 2011 currently no longer support Word 5.1 I'm using the previous Office 2004. I can read 5.1 files and saved themmanually as .doc files on Snow Leopard.
However the files are many and I have this script
set inputfolder to (choose folder) as text
set destFolder to (choose folder) as text
set theFiles to list folder inputfolder without invisibles
activate application "Word"
repeat with x from 1 to count of theFiles
          set thefile to item x of theFiles
          set inputfile to (inputfolder & thefile)
          tell application "Word"
  open document inputfile
                    save document 1 in (destFolder & thefile & ".doc")
  close document 1 saving no
          end tell
end repeat
Trying to open the files I need to convert and save them in a different folder.
However I always get an error from AppleScript Version 2.3 (118)
error "Microsoft Word got an error: document \"Disk:Word_Files:a:  New Files:General Stuff:conv\" doesn’t understand the open message." number -1708 from document "Disk:Word_Files:a:   New Files:General Stuff:conv"
If anyone can help or give another solution to batch convert I will be very glad and happy new Year to all

Thanks all however if anyone is interested this is the solution it works till the current office version:
set inputfolder to (choose folder) as text
set destFolder to (choose folder) as text
set theFiles to list folder inputfolder without invisibles
activate application "Microsoft Word"
repeat with x from 1 to count of theFiles
          set thefile to item x of theFiles
          set inputfile to (inputfolder & thefile)
          tell application "Microsoft Word"
  open file inputfile
  save as document 1 file name (destFolder & thefile & ".doc")
  close document 1 saving no
          end tell
end repeat
The only drawback is:
if the selected destination folder is inside the input folder the script will give error and stop
however this doesn't happen if the "destination folder" is somewhere elese from the selected input folder
Regards and Happy new year

Similar Messages

  • My Adobe XI software no longer converts Word to PDF files with hyperlinks or page layout preserved.

    Is anyone else having the same problem where the initial installation worked fine and over time, you are no longer able to adjust the setting in the 'convert to PDF' menu for Word documents?  I am now faced with Word documents that lose their hyperlinks on conversion and when there are changes in page orientation (e.g., portrait to landscape and back again), the software creates sub files for each kind of page layout.  In a word, the software has become useless.  What can I do to fix this?

    In order to preserve links on Mac Word to PDF. You need to do as follows (note this only preserves links created by Word's auto Correct. Not by Word's URL Creator.)
    Method #1
    Create Document save as .docx as backup.
    Go to File Menu > Print
    Click and hold the PDF button, a Context menu appears.
    Choose Adobe Quality PDF, or Adobe PDF (depends upon Version of Mac OS X)
    First Choose quality (similar to Job Options in Distiller) and whether to open using Acrobat Or Reader.
    Next a Title will appear. (in format "microsoft.nameoffle.docx.pdf").
    You can leave file name as is or remove the Microsoft and the .docx from the Name
    Save File.
    This method also will print pdf, even if it has section and Page breaks except when there is orientation change from Portrait, or landscape.
    Method #2
    Do step 1 above.
    Locate the file Created.
    Drag the file either on top the actual Application or its Icon in the Dock.
    Wait ......
    When Acrobat opens Immediately save.
    Again all links created with Auto-correct will be live.
    And pages will be intact in the PDF except when there is a Change in orientation.
    Auto correct will create links/URL's  when you type such the will automatically turn blue and become underlined. And clicking on the in the word Document  will go to the link.
    What does not work until Adobe fixes a 10-15 year old bug is where you select word then go to Insert menu> URL. A window opens and you choose the link or email, in the URL Creator.
    Also the Bug where changes in section, and pages breaks cause new PDF that have to be put together has not been completely cured. (Still splits when orientation changes.) Has been proved by Microsoft to be a Bug Adobe can't or won't fix. You simply take a Mac Word File open it in the PC version and create a PDF. And works perfect.

  • My mac is converting Word and Excel files into Pages and Numbers files when I click to open them (or download and open them) from an email. I do I get this to stop? It's really aggravating.

    My mac is converting Word and Excel files into Pages and Numbers files when I click to open them from an email. Downloading them and opening them doesn't help. How do I make this stop? I don't use iLife and don't want to; my clients are using Office and it's easier for me, except when I have to copy and paste everything they send me from an iLife file back to Word and Excel. Help!!! It's like Apple has become Microsoft, forcing us to use their apps.

    Do you have Word & Excel installed, if yes, navigate in the finder to an example of each, right click and select 'Get Info' scroll down to 'Open With' and select the appropriate program, check the box that says 'Change All'

  • Word/Excel 2003 Files with Actionscript/MXML

    Hello Friends.
    A Newbe question I would appreciate your guidance and support.
    The question is: How can I manipulate (create, update, delete) MS Word Excel 2003 Files with Action Script and/or MXML?
    Or is there no direct way, do you know about some library, component or extension that would allow me to do that using Action Script and/or MXML ?
    Thanks in advance for your help.
    Carlos

    if you're using the web, you'll need to have user's upload their files and you'll need to use server-side code to edit them and you'll need to use server-side code to create them.  there's no way to delete files (thank goodness) from a web-based swf.
    adobe air can be installed and work directly with the client's files but how and whether you can edit/create word/excel files is not likely without using a pre-built library and i don't know if anyone has built one.

  • How do I convert an Adobe pdf file with sound assist for the visually impaired to use the keyboard to play audio?

    I am trying to convert an Adobe pdf article file with a play button to an iTunes or other accessible file for people with visual impairments.  The file has been converted to a format that has a play button; however, the computer does not have a keyboard stroke that leads to the play button.  In other words, the play button isn't integrated into the accessible format; only sighted people can access the play button.  The individual is using an Apple laptop.
    Can someone help me please?
    Thanks!

    http://www.macworld.com/article/1162699/how_to_convert_pdfs_to_word_and_other_fo rmats_.html
    https://itunes.apple.com/us/app/pdf-converter-free/id422540367

  • Problem in converting word to html- file get error msg 'This command is not available because no document is open'

    Hi,
    I write the some asp code to save the word file from client machine to server machine , and convert it into the html file.
    it working fine when i debug the code into the visual studio but when i deploy code on iis it give me a error 'This command is not available because no document is open' , while i try to save file into html format.
    lot of time i try this give all the security full access to iis user and other things .
    can any one help me. i fully frustrated from this problem. 
    my need only upload the word document from client to server machine and convert it into the word document. 
    only IIS give me the problem, suggest me what setting i need to do in iis 
    please help me humble request 

    Hi,
    In this forum we mainly discuss questions about Office client questions and feedbacks, issues related to coding are not supported here.
    Based on the description, although the question is about converting Word documents, it's more likely to be a permission issue, the question is better to be posted in the IIS.NET forum:
    http://forums.iis.net/
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.
    Regards,
    Melon Chen
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs. Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Uploading a File with AppleScript via JavaScript

    Hi everybody,
    being new to AppleScripting and JavaScripting I'm faced with the following problem:
    Is it possible to make AppleScript to input the path for a file to be uploaded via JavaScript? If yes, what should be the correct Path Format and how to wrap it up the JavaScript action into AppleScript? I've tried a few comands but to no success.
    On the webpage in question, there's a "Choose" button, that is defined as follows:
    <input type=​"file" class=​"gwt-FileUpload" name=​"swfFile">​
    I've been trying to use the following syntax:
    do JavaScript "document.getElementsByName('swfFile')[0].value('Macintosh HD:Users:myaccount:Desktop:Scrapbook:!动画.swf')" in document 1
    as well as this one, where the Path is definitelly understood by shellscript:
    do JavaScript "document.getElementsByName('swfFile')[0].value('/Users/myaccount/Desktop/Scrap book/!动画.swf')" in document 1
    The name of the file is (and must remain) in chinese, but for testing purposes I have also tried files with english names, without success.
    Currently I'm using a solution with JavaScript comand:
    do JavaScript "document.getElementsByName('swfFile')[0].click()" in document 1
    to click the finder  window to browse for the file, and manipulating  keystrokes by using System Events to find the right file, but it's not  infallible with a number of files and it's hardly an ellegant sollution.
    Any idea what I'm doing wrong?
    Cheers!

    @twtwtw
    the do JavaScript "document.forms[0].submit()" command didn't work, so I kept the original way of submitting by clicking the button. The submitting part works, but not the input file part.
    That's the code I used
        tell application "Safari"
            do JavaScript "document.getElementById('gwt-uid-13').value='on'" in document 1
            do JavaScript "document.forms[0].elements['swfFile'].value=" & "'" & SWFFilePath & "'" in document 1
            do JavaScript "document.getElementsByClassName('gwt-SubmitButton')[0].click()" in document 1  
            delay 1
        end tell
    with SWFFilePath set as the POSIX path as well as the default file format
    Macintosh HD:Users:myaccount:Desktop:Scrapbook:!动画.swf'
    but it did not work.
    If you've got the time, feel free to upload an .swf. The service is free and the server delats uploaded files after 15 min. (if you don't have any, you may try an empty .txt file instead - it won't get converted, but the point is just to get it into the input box).
    In the meantime, I'll have a look at adayzdone's suggestion. It's not perfect (the downside being that it requires the window to be active, so I can't run the script in the background or with my screensaver & password on), but it's still more reliable than my sollution with navigating arrowkeyes.

  • I can't convert .cr2 canon raw files with DNG converter.

    I have a Canon 1000D, and im trying to open RAW files to edit in cs4. Everytime i open it, photoshop says that it doesnt recognise this type of file, but i open my friends RAW file (450D) and it can read it. I have also downloaded DNG converter, and it comes up with this message (first image) but my folder has .cr2 files......im really lost
    I have also asked for help on the photoshop forum, but they referred me here...
    Thanks

    That file is only 2.7 megabytes.  Raw files are usually larger.  That likely means it's truncated (cut off prematurely).
    You haven't selected one of the modes called sRAW (Small Raw) have you?
    Like Tai Lao, I was able to extract a JPEG, and the EXIF data for the JPEG seems to be intact:
    Filename - _MG_6825.CR2
    ImageWidth - 1936
    ImageLength - 1288
    BitsPerSample - 8 8 8
    Compression - 6 (JPG)
    Make - Canon
    Model - Canon EOS 1000D
    StripOffset - 42212
    Orientation - Top left
    StripByteCount - 228990
    XResolution - 72
    YResolution - 72
    ResolutionUnit - Inch
    DateTime - 2011:05:23 12:15:31
    ExifOffset - 270
    ExposureTime - 1/4000 seconds
    FNumber - 5.60
    ExposureProgram - Aperture priority
    ISOSpeedRatings - 1600
    ExifVersion - 0221
    DateTimeOriginal - 2011:05:23 12:15:31
    DateTimeDigitized - 2011:05:23 12:15:31
    ComponentsConfiguration - YCbCr
    ShutterSpeedValue - 1/4096 seconds
    ApertureValue - F 5.66
    ExposureBiasValue - -2
    MeteringMode - Multi-segment
    Flash - Flash not fired, compulsory flash mode
    FocalLength - 115 mm
    UserComment -
    SubsecTime - 03
    SubsecTimeOriginal - 03
    SubsecTimeDigitized - 03
    FlashPixVersion - 0100
    ColorSpace - Unknown (0xFFFFFFFF)
    ExifImageWidth - 3888
    ExifImageHeight - 2592
    InteroperabilityOffset - 37768
    FocalPlaneXResolution - 4438.36
    FocalPlaneYResolution - 4445.97
    FocalPlaneResolutionUnit - Inch
    CustomRendered - Normal process
    ExposureMode - Auto
    White Balance - Manual
    SceneCaptureType - Standard
    Maker Note (Vendor): -
    Macro mode - Normal
    Self timer - Off
    Quality - RAW
    Flash mode - Not fired
    Sequence mode - Single or Timer
    Focus mode - One-Shot
    Image size - Large
    Easy shooting mode - Manual
    Digital zoom - None
    Contrast - Normal
    Saturation - Normal
    Sharpness - Low , -32769
    ISO Value - 32767
    Metering mode - Evaluative
    Focus type - Auto
    AF point selected -
    Exposure mode - Av-priority
    Focal length - 18 - 200 mm (1 mm)
    Flash activity - Not fired
    Flash details -
    Focus mode 2 - 65535
    Auto ISO - 100
    Base ISO - 1600
    White Balance - Sunny
    Sequence number - 0
    Flash bias - 0 EV
    Subject Distance - 0
    Image Type - Canon EOS 1000D
    Firmware Version - Firmware Version 1.0.7
    Owner Name -
    Camera Serial Number - 2950600230 (AFDE38438)
    Camera Temperature - 17 C
    Sharpness (1D) - 0
    Directory index (450D) - 142
    File index (450D) - 1
    File number - 000 - 0000
    Sharpness (A0) - 0
    Thumbnail: -
    JpegIFOffset - 38124
    JpegIFByteCount - 4087
    -Noel

  • Converting Canon S90 CR2 files with DNG 5.6

    I have converted files from my S90 with the latest version of DNG Converter. When I compare the DNG file to the original CR2 file, there is a marked increase in saturation, and also more noise. Am I doing something wrong with the conversion? Help please. I am using Adobe RAW 4.6 with Photoshop CS3. Comparative files can be viewed at http://dobbino.blogspot.com/2009/11/dng-converter-canon-s90-raw-files.html

    The 5.6 Trial versions can be found here

  • HOW TO USE OGR2OGR  TO CONVERT DGN  INTO SHAPE FILES WITH MSLINK

    hi Friends...
    i had a requirement to convert the dgn file into shape files with its mslink and entity number. can any body give guidelines .........pls
    Rajanikanthc

    Bentley Map will do this for you.
    Open the DGN, connect to the database for the attribute
    Export->GIS Datatype,
    pick export, right click, new export
    pick directory if you have mulitple level
    pick export, right click and export

  • Find a file with AppleScript

    Hi everyone !
    Is there a way to find a file using AppleScript ?
    The "find" command in the finder seems not working or I have a problem with the syntax.
    In an other hand, I dont find any way to script Spotlight...
    I hope I am wrong
    Any idea will be welcome
    JPaul

    Hi Jeanpauld,
    It works fine.
    As the final use is in a FileMaker pro data base, I
    prefer this solution.
    Glad to hear the script worked for your particular situation.
    In which dictionnary can I find SpotlightSearch ?
    "SpotlightSearch" is just what I named the subroutine of the script. You could name it whatever you like but I figured that would be a good name for it since it uses the spotlight technology to perform the search.
    As Joseph Briggs pointed out the best way to get information about the mdfind command used in the do shell script portion of the SpotlightSearch subroutine is to use the Terminal application. Launch the Terminal and type man mdfind.
    If you have any further questions regarding this command please feel free to ask and I would be glad to try and help you through it. There's quite a bit that can be done using the mdfind command!
    Thanks a lot for your help !
    Anytime Jeanpauld.
    Sorry about not replying to your response sooner but the new discussion forum format is refusing to email me letting me know when my subscriptions get updated. I used to rely on that feature and will have to keep my own eye on my subscriptions for a bit while Apple works out the bugs in the new forums.
    Take care Jeanpauld...

  • Edit/update config file with Applescript??

    am trying to read the file and then trying to change the values of the same with permissions, pls suggest how to write the same file with permissions.
    The below script gives me the values as shown below, i need to change those values like aaaaa to 1, pls suggest.
    set fileContents to {}
    set x to ""
    set filepath to POSIX path of "Macintosh HD:Library:Application Support:Macromedia:abc.cfg"
    try
        open for access filepath
        set fileContents to (read filepath)
        close access the filepath
    on error
        return false
    end try
    fileContents
    output :
    "aaaaa=0
    bbbbbbb=0

    If you want to write to the file you need to open it with write permissions
    open for access filepath with write permission
    Ideally you should store the result of that command as a reference to the opened file:
    set myFile to open for access filepath with write permission
    now you can read the data:
    set fileData to read myFile
    You can erase the file by setting the EOF to 0:
    set eof myFile to 0
    (otherwise writing to the file appends data, rather thatn overwriting it)
    You can write data to the file:
    write "blah blah blah" to myFile
    and close it when you're done:
    close access myFile

  • Converting Word (97-2003) docs with tables

    I have tried converting a few Word docs with tables using Acrobat.com. There is one small image in the upper right corner that in the converted doc stays in the same place so I know that is not the issue. What happens is that the converted document takes a nicely formatted document with tables and nested tables and turns it into a 4 page document and places all of the information in a larger table in the first column and looks nothing like the original with the exception of the header.
    I figured out that if I save the file to ODT that only the font gets changed (but this can be fix on my end by using a supported font). However, the person responsible for converting documents in the future after me neither has Acrobat pro or a way to save files in ODT format (they refuse to upgrade to Word 2007 for some reason so no ODT or Convert the PDF/XPS plug-in for them) so Acrobat.com is a sollution I was looking into to keep productivity going.
    If needed, I can send the original documents for anyone who would like to troubleshoot them and give feedback on what I could try so that they will work on Acrobat.com in ODT format.

    Thank you for your post. Would you please send along some sample files to us? Please reference this forum post, and I'll pass the files along to our QA folks for testing. Hopefully we'll be able to resolve the issue shortly! One more thought - you might try either creating your original document in Buzzword, then converting to PDF OR importing the word file to Buzzword, making any edits, and then converting to PDF. Could help. Let us know!
    Michelle

  • Can't rename file with Applescript

    Hi,
    I'm a programmer but I'm new to Automator and Applescript. I am trying to rename pdf files based on a specific line of its content but I don't succeed. I created a service that exports the text from the pdf to a file. Then I use applescript to read that specific line from the file, then another applescript to rename the pdf to that string. Every step works except the rename part. When I tell Finder to rename the file it stops with the error: "The operation can't be completed because there is already an item with that name." This is not true, but I keep getting this error message no matter which file I try it with.
    The odd thing is that if I set varName to some constant like
    set varName to "METEOR CEE Kft..pdf"
    it works like a charm. So I figured maybe
    item 1 of input & ".pdf" = "METEOR CEE Kft..pdf"
    is false. But that is not the case, I tested it in the script and they are equal.
    What am I missing?

    I think that the problem is that there is a lot of invisible characters in the text file when Automator extracts a PDF to plain text (open the file in a text editor and turn on "view invisible characters", or use cat -e in Terminal)
    I've gotten around this is the past by extracting to a RTF and then using textutil to convert to txt
    Try this Automator Workflow:
    The bash script is:
         textutil -convert txt "$1"              # Convert from RTF to TXT    
         n=$( sed -n '9 p' "${1%.*}.txt" )         # extract line 9 fron text file
         mv "${1%.*}.pdf" "${1%/*}/$n.pdf"     # Rename file
         rm "$1" "${1%.*}.txt"                         # Clean-up RTF and TXT files

  • When converting word doc to pdf with Acrobat words getting cut off?

    Hi all,
    As you can see from this example:
    When converting from word document the words on the pages in the final PDF are getting cut off on the edge of the page?
    I've adjusted the margins in page layout in MS Word to Normal, Moderate & Wide etc, etc
    Never ever had this problem before...does anybody have any idea why or what I could do?
    Thanks in advance.

    As a quick check, set the printer to the Adobe PDF printer in WORD and then check for the proper operation. Also be sure the paper dimensions and orientation of your document and the printer properties match up (I have had some problems with the orientation when I have auto-rotate on). You may have to play some to get something to work. I have done that before and settled on a process that works for me, but I can't claim it all makes perfect sense. To many things are going on in some sense.

Maybe you are looking for

  • Exchange 2013 /m:recoverserver constantly failing due to MSExchangeSubmission.exe

    Hi all, I am trying to recover my lab Exchange 2013 server after removing a component of IIS messed all IIS functions, including all virtual directories. The server is running on Hyper-V so I have removed and rebuilt the OS disk whilst the Exchange d

  • Error while trying to print in AutoCAD

    Using AutoCAD 2008 Full Acrobat X Standard Windows7 32-bit My coworker gets this from time to time.  It seems pretty random.  All the drawings are started from the same templat file and no one else with the same version of CAD/Acrobat is getting this

  • Problem creating an jar file!

    Hello. I am trying to create an executable jar file using the following command: jar cmf MANIFEST.MF game.jar *.classHowever, I keep receiving the following error: java.io.FileNotFoundException: MANIFEST.MF (The system cannot find the file spec ified

  • Purchase order created

    I want to know the PO's created on a particular day with time. I went on to the SE16 & entered the table MKPF @ the inital screen and in layout  I gave the time of entry. When I enter the doc. No. & date the system doesn't gave  me the Time of entry.

  • Story  Plus won't download to Windows 8.1

    When attempting to download Story Plus to my Windows 8.1 computer, I'm told it won't work with my current Explorer version.  Windows 8.1 comes with Explorer 11.  Story Plus apparently won't work with anything higher than Explorer 9.  Anybody know how