How do I toggle between "Portrait" and "Landscape Right" orientation in the iOS simulators via AppleScript?
iOS Simulators – Toggle Between Portrait and Landscape Right via AppleScript
applescriptiosios-simulatormacos
Related Question
- IOS – How to rotate a movie on the iPad/iPhone
- Toggle Show Date and Time via AppleScript
- MacOS – El Capitan Terminal command to toggle clock between Analog and Digital
- iOS – How to Enable Arrows in Landscape Keyboard in iOS 11?
- MacOS – Moving document windows to a particular screen and location
- IOS 11 & Apple Maps: Hide Search Box in Landscape Orientation
- macOS and iOS – How to Filter and Sort Videos by Orientation
- AppleScript – Script to Sort MP4 Videos by Orientation to Portrait and Landscape Folders
Best Answer
On my system, using Script Editor, the following example AppleScript code works for me to toggle between Portrait and Landscape Right of the Simulator window:
Note: The example AppleScript code is just that and sans any included error handling does not contain any additional error handling as may be appropriate. The onus is upon the user to add any error handling as may be appropriate, needed or wanted. Have a look at the try statement and error statement in the AppleScript Language Guide. See also, Working with Errors. Additionally, the use of the delay command may be necessary between events where appropriate, e.g.
delay 0.5
, with the value of the delay set appropriately.