I have written to a Microsoft Word AppleScript which among other things:
- Start Word
- Open a Word file
- Positions the Word file / window
- Minimizes the Word file / window
The script is as follows:
tell application "Microsoft Word"
activate
set currentDate to current date
set currentYear to year of currentDate as text
set currentMonth to month of currentDate as number as text
set currentDay to "01"
set filePrefix to currentYear & currentMonth & currentDay
set fileToOpen to "/Users/JoelC/Documents/Projects On The Go/To Do Lists/" & filePrefix & "_joel cohen outstanding items list.docx"
set fileWindow to currentYear & currentMonth & currentDay & "_joel cohen outstanding items list.docx"
open fileToOpen
tell its window fileWindow
set bounds to windowPosition
set miniaturized to true
end tell
end tell
The problem that I am having is that the minimize command is not working.
When I dig into the Word Dictionary I see the below which appears – at least to me – as though Word is not reading / responding to the Miniaturized property (i.e. I would have expected a true or false value) which explains why the above code is not minimizing the Word window.
I would greatly assistance and/ or input on this.
Thanks.