Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ButchDeClue

macrumors newbie
Original poster
Oct 16, 2008
1
0
I am trying to learn to write AppleScript. I have written a simple script to insert a date into a Word document at the point where the cursor is. However, I cannot get AppleScript to insert the date as text. No matter what I write, the date gets inserted as a field which updates the date every 24 hours.

Here is the AppleScript that inserts the date as a field:

tell application "Microsoft Word"
insert date time at text object of selection date time format "Mddyy" with insert as field
end tell

Here is the AppleScript that is supposed to insert the date as text that remains the same from day to day, but when it runs, the date gets inserted as a field:

tell application "Microsoft Word"
insert date time at text object of selection date time format "Mddyy" without insert as field
end tell

In MS Word's AppleScript dictionary, the boolean phrase "insert date as field false" is mentioned, but if you put that into the AppleScript and press 'compile,' it gets turned into the "without insert as field" and behaves just as I mentioned above (inserts the date as a field, not text).

Help or suggestions would be appreciated.

ButchDeClue
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.