Jump to content

dfay

Member
  • Posts

    1,054
  • Joined

  • Last visited

  • Days Won

    61

Posts posted by dfay

  1. Hammerspoon - what a fascinating tool that I've never heard of before. Potential for use with Alfred Remote seems huge - able to do a lot of what I'd thought of trying to do with AppleScript and Moom and cliclick and various other tools all in one. Thank you for bringing this to the forum.

  2. Yeah, I've read that thread and while you say it's not working, you don't explain the point at which the instruction provided is breaking down.  Here is a detailed explanation of the full process:

     

    1. Open Alfred Preferences

    2. Click Workflows
    3. Click the workflow (in the list on the left) which you want to add to Alfred Remote
    4. When the workflow components appear, click the + in the upper right
    5. In the Triggers pop-up menu select Remote
    6. In the Remote sheet that appears, provide a label (the text that will appear in Alfred Remote, an identifier (which can be pretty much anything as long as it's unique - it's only used behind the scenes), and optionally include an argument that you want to pass to the workflow.  Leave availability unchecked.  Drop an icon if you have one ready - you can always add it later.  Once both required items (label and identifier) are ready, the Save button will be enabled.  Click Save.
    7. Hover over the new Trigger and a tab will appear on its right side.  Click and drag from the tab to the workflow object you want it to run.
    8. In the toolbar, click Remote to switch over to the Remove editor.
    9. In the list on the left, click the remote page on which you want your new item to appear, or click the + sign in the lower left and fill in the information in the drop-down panel to create a new page.
    10. When the remote page appears (in the center of the window), hover the mouse over one of the squares that doesn't have an icon in it, and click the plus sign that will appear there.
    11. In the pop-up menu that appears, scroll to the bottom and select Run Workflow Trigger, then the name of the workflow you just modified, then the name of the trigger you just added.
    12. The trigger will now appear in Alfred Preferences, and in a matter of seconds it will appear in Alfred Remote (assuming your device is connected).
     
    Can you indicate which of these steps are giving you problems?
  3. @DrLulz

    I was curious to see if this can be done entirely in a native AppleScript version or at least cutting out the python by using AppleScriptObjC....

     

    I got the following parsimonious bit of code to work in Script Editor, but I haven't had time to try to import it as a library into your script:

     

              use framework "Cocoa"

     

    on isControlKeyPressed()

    current application's NSEvent's modifierFlags as integer = current application's NSControlKeyMask

    end isControlKeyPressed

     

    delay 3

    isControlKeyPressed()

     

     

    (last two lines are just there for testing purposes)

     

    Doing a Skim search with dictation and then advancing page results with Alfred remote. 

     

     

    1. Remote Trigger --> Keyword

    2. Dictate Query --> Skim Search Applescript

    3. Use Run Script on the Remote to advance page results. (icon)

     

     

    The search Applescript is "listening" (not really, but you get the idea) for keypress with: 

     

    on isControlKeyPressed()

    return (do shell script "/usr/bin/python -c 'import Cocoa; print Cocoa.NSEvent.modifierFlags() & Cocoa.NSControlKeyMask > 1'") is "True"

    end isControlKeyPressed

     

    To advance the page use:

     

    tell application id "sevs"

    control key down

    delay 0.2

    control key up

    end tell

  4. I had a similar problem with two versions of Radium in Applescript the other day.  You can get the id as described here: http://www.macosxautomation.com/applescript/features/appobject.html

     

    Just open Script Editor, and run the following one-liner:

     

    get id of application "FakeApp"

     

    Script Editor will ask you "Where is FakeApp?" and open a list of installed apps.  Select the correct version of PowerPoint there and you'll get its id.

     

    You can then address it 

     

    tell application id "com.microsoft.PowerPoint" (or whatever the actual id is)

     

    instead of

     

    tell application "PowerPoint"

     

     

     

     

    Applescript is weird.

  5. Download from http://www.packal.org/workflow/skim-remote

     

    # Skim Remote

    ## Control Skim with Alfred Remote
     
    Out of the box, Skim Remote provides a remote to cover presentation needs in Skim.
     
    screenshot.png
     
    ## Roadmap
     
    * Direct scrolling is currently unsupported in Alfred Remote, but as soon as it is, I'll add it here.
    * I only created icons for the default commands, but I have the template and can create additional ones if there's demand.
    * implement goto_bookmark()
     
    ## Details
     
    The heart of the workflow is a single Applescript, SkimUI.scpt, that defines the following handlers:
     
    ### View
     
    single_page()
    single_page_continuous()
    double_page()
    double_page_continuous()
    page_breaks_on()
    page_breaks_off()
    normal_mode()
    full_screen_mode()
    presentation_mode()
    zoom_to_fit()
    zoom_in()
    zoom_out()
    zoom_to(z) where z is the desired zoom (1 = 100%, 0.5 = 50% etc.)
     
    ### Navigation
     
    goto_last_page()
    goto_first_page()
    next_page()
    prev_page()
     
    ### Info
     
    pages()
    file_name()
    ESC() - used for clearing large type display of pages or file name
     
    ## Customization
     
    The Applescript to call one of these (e.g. file_name) looks like this:
     
    set workflowFolder to do shell script "pwd"
    set sk to load script POSIX file (workflowFolder & "/SkimUI.scpt")
    sk's file_name()
     
    This could easily be extended:
     
    set workflowFolder to do shell script "pwd"
    set sk to load script POSIX file (workflowFolder & "/SkimUI.scpt")
    sk's full_screen_mode()
    sk's zoom_to(1)
    sk's single_page_continuous()
    sk's goto_first_page()
  6. See http://www.alfredforum.com/topic/5430-solving-the-icon-bottleneck-ideas/

     

    Setting icons depends on whether you're on the remote config screen or in a workflow.  For the former, just double-click on an existing item and the configuration panel includes the icon image which you can drag-and-drop to replace.

     

    For the latter, when you create a remote trigger, you drop an icon on it.  Then when you add that trigger to the remote config screen or to a workflow remote page, it'll use the trigger's icon.  If you change the icon in the workflow, there's a refresh button on the remote config screen and workflow remote pages that'll pull in the latest icon.

  7. I saw comments like this in a couple of the reviews as well.  Here are the kinds of scenarios I've been using (in the few days).

     

    1st is with dictation as I described in another post - you can open stuff on your Mac and interact with it quite well from a distance this way.  I'd been working with dictation on the Mac a bit over the past few months and Alfred Remote is a great complement to it for hands-free use.

     

    2nd is for "across the room" type tasks for which existing remote solutions don't exist or aren't adequate.  I wrote the Aperture Remote workflow to be able to triage photos (i.e. give a preliminary rating / flag for future editing / printing, keepers vs. trash, etc.) from a distance.  (On the other hand, I'm not going to give up using Keynote's built-in remote since that offers a lot of facilities, notably presenter notes, that can't be implemented in Alfred Remote as it stands).  Also "now playing" for apps (like Radium) which don't provide this facility in a large screen format.  I'm also working on a workflow to open Safari in full-screen (couldn't get Chrome's kiosk mode automated....may try Plainview instead, too) for use with Hootfeed.  And I want to write a remote for Skim's presentation mode, ideally one that would switch to Skim in presentation mode and turn on mirroring, then allow me to turn off mirroring and switch back to Keynote.  (I regularly teach in large lecture halls where I prefer to be able to leave the podium, so this is quite appealing).

     

    3rd is one I didn't expect but which I found myself using a lot.  I have limited desk real estate at work and end up with my laptop in front of my keyboard in front of my desktop.  I found using the desktop with the trackpad at my right hand and Alfred Remote at the left a lot easier than using the trackpad alone (i.e. for a lot of the same situations where I'd normally use Alfred at the keyboard rather than a mouse-based operation).  This a scenario where the desktop is primarily used for reading, listening, watching, and the real work is getting done on the laptop.

     

    --Derick

  8. There is an existing alfred:// URL scheme on the Mac but I believe it's only used for adding workflows and themes at the moment.  I tried typing an alfred:// URL into Safari on the iPhone and got a Cannot Open Page message.

     

    This is totally unrelated (or really, the exact opposite of what is being asked for) but I stumbled across this interesting link about using Alfred for Mac to run URL schemes on iOS devices: http://www.geekswithjuniors.com/note/launch-ios-actions-from-the-mac-using-alfred-and-command-c.html

  9. I've been working on a couple larger workflows (the Apps and Spaces one elsewhere in this forum, and a remote for viewing and rating photos in Aperture*).

     

    What I've found with both is that writing the workflow scripts and setting up the remote triggers can be done fairly quickly, but then I'm left with the task of locating or creating 12-15 icons for each of the commands on the remote.  Which means a whole lot of searching in Google Images, and/or downloading a stock icon set only to realize that it doesn't have a couple that I need, or spending a lot of time in iDraw....  The visual nature of Alfred Remote (especially with big icons on a Retina iPad....) has added a fairly substantial step to the workflow creation progress.

     

    I'd like to suggest a couple possible solutions or at least ways to help out this situation:

     

    1) could we get copies of the template (assuming there is such) used to make the Alfred Remote System Command icons?

     

    and 2) perhaps there could be a separate forum like the Themes forum dedicated to sharing icon sets?  Then those of us with skills and time to devote to beautiful icons (of which I have neither) can easily make them available for remote workflow development.

     

    Thanks

    Derick

     

     

     

    * Yes, I know Aperture is discontinued but I have 6 months of unsorted photos and Apple's new Photos app is a distant speck on the horizon.  And the remote should be easily adaptable to Photos when it comes out.

  10. No....well almost no.  Enter works, but only in text. i.e. if you create a remote command to paste enter from a clipboard snippet, it'll paste an enter in a text document.  But it won't work for hitting the enter key e.g. in a file save dialog.  For this you want to use Applescript and System Events.

×
×
  • Create New...