Jump to content

Toontje

Member
  • Posts

    17
  • Joined

  • Last visited

Posts posted by Toontje

  1. set hostnames to {"pi@host1.local", "pi@host2.local", "pi@host3.local", "pi@host4.local", "pi@host5.local", "-p 12345 gregorio@host12"}

    if application "iTerm" is running then
            tell application "iTerm"
                    create window with default profile
                    tell current tab of current window
                            select
                            tell current session

                                    -- make the window fullscreen
                                    tell application "System Events" to key code 36 using command down
                                    split horizontally with default profile

                                    set num_hosts to count of hostnames
                                    repeat with n from 1 to num_hosts
                                            if n - 1 is (round (num_hosts / 2)) then
                                                    -- move to lower split
                                                    tell application "System Events" to keystroke "]" using command down
                                            else if n > 1 then
                                                    -- split vertically
                                                    tell application "System Events" to keystroke "d" using command down
                                            end if
                                            delay 1
                                            write text "ssh " & (item n of hostnames)
                                    end repeat
                            end tell
                    end tell
            end tell
    else
            activate application "iTerm"

    end if

  2. 7 minutes ago, raguay.customct said:

    With all these outside resources, there's no need to add it to Alfred, but create the proper workflow for you using the other tools. That's where you get the real power of Alfred. Not a single, mega program that does everything. The Unix philosophy is many small, one purpose programs working together.

     

    Yeah, as you can read in the message above, i like one tool that does all instead of learning all kinds of different tools that only do one thing (and now you are going to tell me "and do that one thing right").

  3. @vitor Thanks! I will look in to that. I would like Alfred to be the goto app for all Mac automation. This instead of an app for search, an app for workflows, an app for tiling, an app for macros, etc.

    I am now using Rectangle but if Alfred works equally well then Rectangle must go. 

     

    Edit: Div is cool! Just what i was looking for.

  4. Use case:

     

    I am copying and pasting text in an editor, website input field or something like that.

    I want to modify/delete/add the first x characters on every line.

    Run the macro x amount of time.

    Optionally save the macro. Only optionally because the chance that i have to do that same thing again in exactly the same way and in the same application is very small.

     

    Building a workflow for this with a Key Mapping is a bit cumbersome fort this one time i need to do this. But..., i do this repetitive work a lot, just not always the same way, the same text, the same modifications in the same applications.

     

    So ideally i would like to have a hotkey that starts recording keystrokes (typing the word "record" in Alfred would also do this), key strokes are recorded until i press the hot key again.

     

    Maybe it already exists. If so, please point me in the right direction to achieve this.n the 

     

    Thanks,

     

    Ton.

  5. 16 minutes ago, deanishe said:

    If the application offers a proper API to achieve what it is you're trying to do, that is always a better, more reliable option. And vim does.

    Many applications don't. Please, enlighten me on the idea why it is possible to send one keystroke from Alfred, but not multiple (a string).

  6. I have a simple question. I want to send a URL to a browser. Or a string to an already active input box in an application. How do i do this? The only thing i can find is Key Combo which sends only one key. I want to send a string.

    Ah, and the Open URL doesn't work for me because i want to send the URL to an already open browser.

     

    It seems such a simple operation, but i cannot figure out how to do it.

  7. I am still learning so bear with me...

     

    I am building a workflow which is taking information from a text document open in vim and pasting it in a browser. For this, in vim, i have to enter a command string like njyt@yt.y$.

    How do i do this in Alfred? I now have 9 key combo objects with 1 letter each, but there must be a better way to do this. Or not?

×
×
  • Create New...