• 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: Hide ribbon in Word
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Hide ribbon in Word


  • Subject: Re: Hide ribbon in Word
  • From: Yvan KOENIG <email@hidden>
  • Date: Fri, 26 Jun 2015 15:02:30 +0200

> Le 26/06/2015 à 13:27, Axel Luttgens <email@hidden> a écrit :
>
>
>> Le 26 juin 2015 à 02:47, Hans van den Broek a écrit :
>>
>> Turns out you can turn off the ribbon in the Word Preferences. No ribbon when you run Word…
>>
>> Related question:
>>
>> To toggle the ribbon, this works:
>>
>> tell application "Microsoft Word"
>> 	tell application "System Events"
>> 		key code 15 using {option down, command down}
>> 	end tell
>> end tell
>>
>> while using keystroke "r" doesn’t work. Can anybody explain, please?
>
> Hello Hans,
>
> This one works here:
>
> 	tell application "Microsoft Word" to activate
> 	delay 1
> 	tell application "System Events"
> 		keystroke "r" using {option down, command down}
> 	end tell
>
> The delay may probably be shorter, but the idea is there: the keyboard event is sent to the frontmost application, and that application must be ready to do something with it.
>
> As far as I can tell, "keystroke" and "key press" appear to be equivalent.
>
> Of course, since the same may be achieved by setting Word’s property "display ribbon", there is no real point to unreliably go thru keyboard events…
>
> HTH,
> Axel


Better use :

tell application "Microsoft Word" to activate
tell application "System Events" to tell process "Word" # check that it's the real name of the process, I don't own/use this application
	set frontmost to true
		keystroke "r" using {option down, command down}
	end tell
end tell

Putting explicitly the process at front allow us to work without the delay whose required duration isn't known.

Yvan KOENIG (VALLAURIS, France) vendredi 26 juin 2015 15:02:20





 _______________________________________________
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: 
 >Hide ribbon in Word (From: Hans List <email@hidden>)
 >Re: Hide ribbon in Word (From: Hans van den Broek <email@hidden>)
 >Re: Hide ribbon in Word (From: Axel Luttgens <email@hidden>)

  • Prev by Date: Re: Hide ribbon in Word
  • Next by Date: Re: Double Tell - Tell by Variable Question
  • Previous by thread: Re: Hide ribbon in Word
  • Next by thread: Mac InDesign CS5.5 & fonts
  • Index(es):
    • Date
    • Thread