Jump to content
mac98aop

How to create a Safari Develop menu workflow

Recommended Posts

Hi everyone

 

I'm a longtime Alfred PPack user, but never really taken the time I should have done to make the most of Workflows.

 

I use the 'Open in Chrome...' workflow when I stumble across a page with Flash in Safari, but now realise I could reload the page for iOS from the Safari> Develop menu.

 

Is it possible I can write a Workflow to do this?

 

Thanks so much

 

Adam

Share this post


Link to post

It is possible, though it requires some GUI scripting. There you go.

 

Code used:

tell application "Safari" to activate
tell application "System Events" to tell process "Safari" to click menu item "Safari — iOS 10 — iPad" of menu "User Agent" of menu item "User Agent" of menu "Develop" of menu bar item "Develop" of menu bar 1
tell application "Safari" to activate
tell application "System Events" to tell process "Safari" to click menu item "Default (Automatically Chosen)" of menu "User Agent" of menu item "User Agent" of menu "Develop" of menu bar item "Develop" of menu bar 1

This a simple workflow but might be useful to other people. I might publish it officially at a later time, with support for more User Agents.

Edited by vitor

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...