Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add rotate orientation support #14

Open
gslender opened this issue May 1, 2022 · 1 comment
Open

Add rotate orientation support #14

gslender opened this issue May 1, 2022 · 1 comment

Comments

@gslender
Copy link

gslender commented May 1, 2022

If possible, can you add support for setting the emulator/device orientation?

The old screenshots package did this via scripts that on Mac, which just ran the following osascript scpt. Note that it would require running the command [open -a Simulator.app] to ensure the simulator on Mac is visible to the finder before hand.

Not sure how to tackle Android, but suspect there is something you can call/do to activate the same orientation.

on run argv
  my do_submenu("Simulator", "Device", "Orientation", item 1 of argv)
  return item 1 of argv
end run

on do_submenu(app_name, menu_name, menu_item, submenu_item)
    try
        -- bring the target application to the front
        tell application app_name
            activate
        end tell
        tell application "System Events"
            tell process app_name
                tell menu bar 1
                    tell menu bar item menu_name
                        tell menu menu_name
                            tell menu item menu_item
                                tell menu menu_item
                                    click menu item submenu_item
                                end tell
                            end tell
                        end tell
                    end tell
                end tell
            end tell
        end tell
        return true
    on error error_message
        return false
    end try
end do_submenu
@martin-braun
Copy link

Couldn't you just enforce the rotation in the Xcode / Android project just to take screenshots? You might also need to rotate the produced images with ImageMagick. Pretty wild hack, but could actually work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants