• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: List of numbers for encoding in Microsoft Word?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: List of numbers for encoding in Microsoft Word?


  • Subject: Re: List of numbers for encoding in Microsoft Word?
  • From: "Stockly, Ed" <email@hidden>
  • Date: Wed, 05 Aug 2015 17:52:33 +0000
  • Thread-topic: List of numbers for encoding in Microsoft Word?

That is how scripting Word should work. But it doesn't. For example, no result to log when opening or saving docs.
Try this:

set wordDoc to choose file with prompt "Select a Microsoft Word file"

set filePath to wordDoc as text

set savedFiles to {}

set notSavedFiles to {}

tell application "Microsoft Word"

set docWordDoc to open wordDoc

repeat with x from 1 to 100

try

tell document 1

set newFilePath to (filePath & x & ".doc")

  save as file name newFilePath  file format document  text encoding x  line ending type line ending cr lf

end tell

set the end of savedFiles to x as text

on error errMsg number errNum

set the end of notSavedFiles to x as text

end try

end repeat

end tell



set AppleScript's text item delimiters to {return}

set results to {"Saved Files:", savedFiles, "", "", "Files Not Saved: ", notSavedFiles} as text

display dialog results

return results


Ed 


Before trying to do the job in a loop, it would be useful to try to understand what is really happening in a single treatment like :

setxto "path:to:a:word:document.doc" asalias

tell application "Microsoft Word"
set docX to open x
save asdocXfile name (pathof docX & "1.txt") file formatformat text
logresult
log 1
save asdocXfile name (pathof docX & "2.txt") file formatformat textline ending typeline ending cr lf
logresult
log 2
save asdocXfile name (pathof docX & "3.txt") file formatformat texttext encoding 30 line ending typeline ending cr lf
logresult
log 3
save asdocXfile name (pathof docX & "4.txt") file formatformat texttext encoding 5 line ending typeline ending cr lf
logresult
log 4
closedocXsavingno
end tell
 
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >List of numbers for encoding in Microsoft Word? (From: William Adams <email@hidden>)
 >Re: List of numbers for encoding in Microsoft Word? (From: Shane Stanley <email@hidden>)
 >Re: List of numbers for encoding in Microsoft Word? (From: William Adams <email@hidden>)
 >Re: List of numbers for encoding in Microsoft Word? (From: Yvan KOENIG <email@hidden>)

  • Prev by Date: Re: List of numbers for encoding in Microsoft Word?
  • Next by Date: Re: Passing app property names
  • Previous by thread: Re: List of numbers for encoding in Microsoft Word?
  • Next by thread: Passing app property names
  • Index(es):
    • Date
    • Thread