Jump to content

kodiak

Member
  • Posts

    48
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by kodiak

  1. On 8/16/2018 at 1:36 PM, vitor said:

     

    They are. Not sure what happened there.


    I get the following error: [ERROR: action.script] ./dropbox-option-down.scpt: execution error: «script» doesn’t understand the “«event ASTgetlo»” message. (-1708). The error is also reproducible when running the script from the Script Editor.

     

    Sorry about that! The workflow has a dependency which I forgot to mention, it's the AppleScript toolbox: https://astoolbox.wordpress.com.

     

    19 hours ago, CJK said:

    For the benefit of the OP, @kodiak, «event ASTgetlo» is the raw syntax code for AST mouse point location.  The error reported by @vitor relates to the commands from your scripting addition, which the script doesn't understand.  If you're trying to export a workflow, it won't be able to run on any system without the scripting addition included as part of the exported package.


    That's one reason why using scripting additions is disadvantageous.

     

    You're totally right, but since I'm a complete workflow novice I had no idea how to include a dependency within a workflow, and install it upon the installation of the workflow itself (in this case, a simple copy to /Library/ScriptingAdditions/. And since I have the use mouse movement for this script to work, this addition has to be included. Nevertheless, I still can't explain why running the workflow within Alfred fails (unless I introduce delay into the script).

     

    19 hours ago, CJK said:

    I can see you're trying to access the Dropbox menubar pop-up menu, which requires a modifier key to be depressed whilst clicking - something that can't be done conventionally with System Events.  However, if you consider which functions you want to access from that pop-up menu, I believe all of them are accessible through other means, namely the standard left-click pop-up pane, which has a preferences (cogwheel) button and a few other buttons that provide those options.  That will be regularly scriptable using System Events, if you really must go down that avenue.

     

    Actually, I have been considering this approach and indeed it does look like a better solution. I still wish however to resolve the current script's issues, just for the sake of the challenge ;)

     

    P. S. - How do I insert those inline code blocks?

     

    Thanks again!

  2. On 8/14/2018 at 2:16 PM, vitor said:

     

    The regular dropbox action works fine for me. The ⌥ version doesn’t: [ERROR: action.script] osascript: ./dropbox-option-down.scpt: No such file or directory. You haven’t included the script.

     

    Oops, my bad. I thought all workflow objects are included upon exporting it. Below is a link to the (revised) workflow file itself.

     

    https://www.dropbox.com/s/4pmsrhnbv7l8wgd/Status Bar Icons.alfredworkflow?dl=0

     

     

     

  3. 23 hours ago, vitor said:

    When asking for help with a Workflow, please upload it somewhere as we can’t properly help you without access to it. There are multiple places where your code or Workflow setup may be going wrong.

     

    Also GUI scripting is notoriously finicky, and you shouldn’t do more than what you absolutely need. There are ways in AppleScript to activate menus without moving the mouse to click them (not sure they support alternative menus like in this case, though).

     

    1. You're correct, my bad. Here's a link to the workflow (sorry for the mess, it's a work in progress).

    https://www.dropbox.com/s/x0d4fpnia327oot/Menu Bar Icons.alfredworkflow?dl=0

     

    2. I know, I don't like to rely on GUI scripting and even more so on GUI scripting that revolves moving the pointer around, but in cases such as this (where I need to option-click something), there're no other options.

     

    23 hours ago, deanishe said:

     

    I've noticed this. macOS appears to re-compile the script files (or otherwise do something to them) when it runs them.

     

    3. I see, if so, then why it doesn't happen in all scripts?

     

    4. So the only solution to this is to run the scripts within Alfred?

     

    Thanks!

  4. Thank you very!

     

    I have been implementing your suggestion with great success up until this script:

     

    set originalMouseLocation to AST mouse point location
    tell application "System Events" to tell process "Dropbox"
    	set dropboxLocation to position of menu bar item 1 of menu bar 2
    end tell
    set dropboxLocationX to item 1 of dropboxLocation
    set dropboxLocationY to item 2 of dropboxLocation
    AST click at {dropboxLocationX, dropboxLocationY} holding modifier key ast option key
    AST set mouse point location originalMouseLocation

    Whether run within Alfred or by the way of your suggestion, the script behaves weirdly:

     

    1. The last line is not executed (returning the pointer to its original location).

    2. For some odd reason, running this script triggers a Dropbox synchronization for .scpt file, as if something has changed within the script.

     

    Running the script through Script Debugger or Script Editor works perfectly. 

    Help would be very appreciated!

     

    Thanks!

  5. Hi Everyone,

     

    I'm building a small workflow that should run a .scpt file with keyword. I would really like to leave the file as is so I'll be able to edit it using Apple's Script Editor or Script Debugger, as they offer lots of benefits directly aimed for writing AppleScripts. Here are my considerations:

     

    1. Using the Run Script action with the External Script option won't work.

    2. Running the script within Alfred or embedding it in a shell script (and either running it in Alfred or as an external script), and I won't be able to use Script Editor or Script Debugger.

    3. Choosing to run AppleScripts in Alfred's preferences (instead of editing them), and then setting the workflow to simply open a file means relying on intricate paths. Ideally, the AppleScripts would be called from the workflow's folder with as minimal paths as possible (./).

     

    What should I do?

     

    Thanks!

  6. Thanks @deanishe. 

     

    Two further questions:

     

    1. Is there any control over the way Alfred opens user-typed URLs (and also through bookmarks or through Alfred's own history) in the default browser?

    Examples of different ways of opening tabs include:

    • Instead of the active tab
    • If there's more than one tab open, in a new tab next (right) to the last one
    • In a new tab next (right) to the active one
    • In a new window

    And more.

     

    2. I have a USB disk which I occasionally plug into my Mac. When I type the drive's name it doesn't show up in Alfred's results.

    Can I somehow add the drive to Alfred's results, but obviously make it appear (upon searching for it) only when it's plugged in?

     

    Thanks!

  7. On 4/25/2018 at 11:49 PM, deanishe said:

     

    The source code is the canonical source of such information. AFAIK, the only common auto-update mechanisms are @vitor's OneUpdater and my Python and Go libraries. You'll be able to see the OneUpdater node if you open a workflow Alfred Preferences. Workflows built on my libraries typically respond to the query workflow:update and also log their update status to Alfred's debugger.

    1

     

    This essentially means that even if I don't see the OneUpdater node, an auto-update functionality may still exist in the workflow?

    On 4/25/2018 at 11:49 PM, deanishe said:

     

    The source code is the canonical source of such information. AFAIK, the only common auto-update mechanisms are @vitor's OneUpdater and my Python and Go libraries. You'll be able to see the OneUpdater node if you open a workflow Alfred Preferences. Workflows built on my libraries typically respond to the query workflow:update and also log their update status to Alfred's debugger.

     

    This is done by adding "ps" to the "Comments" box of the Info panel for the Photoshop.app?

     

    Thanks!

     

  8. Thanks a lot for the helpful input.

     

    A few additional questions:

     

    1. How can I tell for a certainty whether a workflow has automatic updates or not?

     

    2. Many macOS apps are composed of different - for a lack of a better word - "elements" Two random examples are Google's Backup & Sync, which has a Finder synchronization folder, but also a menubar representation, (with vital information), and a preferences window; and KeyCue, which consists of the actual app and preferences window.

    Is there any way to define that what "element" will be launched upon selecting a matching search result?

    For example, I want "Backup and Sync from Google.app" to launch the software's preferences and not the relevant Finder folder. Moreover, when I select "KeyCue" in Alfred, I want to launch the actual app and not its preferences. And there are many other apps where I would much prefer to directly launch the menubar counterpart, rather than the "main" app.

     

    3. Can I set custom Alfred abbreviations for system commands and applications? (e.g. "fq" for Force Quit, "ps" for Photoshop, respectively)

     

    4. In Alfred's navigation mode, why is the sorting of files is as follows?

     

    mLXQXpl.png

    As you can see, 10, 11 and 12 come before 2. I would naturally expect that 1 would be followed by 2, 3, 4 and so on...

    Is there any way to change the former behavior to the latter one? 

     

    Thanks!

     

  9. Thanks a lot for the immensely helpful replies.

     

    On 4/17/2018 at 3:18 PM, vitor said:

    You can search in Alfred and drag and drop the result directly from Alfred to the save panel.

    1

     

     

    On 4/17/2018 at 9:24 PM, deanishe said:

    You can search in Alfred and drag and drop the result directly from Alfred to the save panel.

     

     

    Sounds like a much better alternative than dragging (the ultimate workflow killer). And I just stumbled upon this wonderful workflow, which brings as close as possible to Alfred navigation in open/save dialogs. I hope macOS will eventually get better in this regard and allow for native solutions to this.

     

    On 4/17/2018 at 3:18 PM, vitor said:

    No.

     

     

    1. So I guess I also can't queue multiple clipboard items into some kind of a "File Buffer" (with the goal of invoking a command at multiple items at once)?

     

    2. Is there any way to sync Alfred's text replacements to my iPhone?

     

  10. Hi everyone!

     

    A few Alfred starter questions. It's going to be quite a long list, as the more I use this wonderful software, the more eager I get to explore its capabilities.

     

    1. Text expansion: do you folks prefer to use macOS's text replacement feature or Alfred's snippets?

    Alfred's offering is superior, of course, but macOS text replacements can be synced to mobile iOS devices, which is very compelling.

     

    2. We all know macOS's open and save dialogs are a nightmare, especially after you're used to efficient keyboard navigation with Alfred.

    Is there ANY way whatsoever to apply Alfred's basic File Search capabilities to the open and save panels?

    If not, is there any other software that can offer this? 

     

    3. I would like to know if there is a way to perform a more intelligent file search (I believe this is also called "fuzzy" search, correct me if I'm wrong) in Alfred.

     

    For example, let's say I have the following directory:

     

    whdS9iT.png

     

    I expect Alfred to find the folder "Red" only if I type a partial string like "do cha re". Similarly, if I type something such as "do cha bl en", ideally Alfed would find "Engine.jpg" inside "/Blue". Launch Bar behaves like this and it works very well! It would be amazing if Alfred would do the same.

     

    4. Is a difference between pressing `+C` (copying) and hitting `` (selecting) on an item from the clipboard history?

     

    5. I noticed that when interacting (whether copying or selecting) with a clipboard item, that item jumps to the top of the list. Is there any way to disable that?

     

    6. Is it possible to activate Quick Look on clipboard items?

     

    7. Is it possible to open the File Action menu for items in the clipboard history?

    Some of the clipboard items are files for all intents and purposes, so making them compatible with File Actions is almost a no-brainer. And I can definitely imagine various File Actions for other clipboard items that are not "files" per se, such as copied images and texts (like Imgur uploading for the former, and creating a new note in Notes for the latter).

     

    Thank you very much!

  11. Thanks @dfay!

     

    But sadly, even refined solutions such as this will never be as smooth as native ones. Prefixing every folder search is a hassle.

     

    Anyway, I didn't imagine such granular control over Finder tabs is achievable. So, while we're at it, is it possible to expand this workflow with more options?

    Stuff like "Reopen Closed Tab", "Close All Tabs but the Active One", "Close All Tabs to the Right/Left" would be incredible.

  12. Thank you so much for this great workflow. It works superbly.

     

    Is it possible that you add a "Restart" option? Ideally, two types of "Restart" would be available:

    • "Quit and Relaunch". For apps that are not really frozen and for some reason just need a restart, I rather quit conventionally to not lose any data.
    • "Force Quit and Relaunch" for apps that are frozen.

    Thanks again!

  13. Thank you for this great workflow!

     

    It's the best among the numerous audio source switching workflows I've tested.

     

    One caveat: sometimes it fails to catch some or all of the audio devices (if there's only partial catching of audio devices, the AirPods are the ones to be omitted, usually), so a makeshift solution I have is to "reload/refresh" the workflow by erasing one letter (pressing ⌫ once, resulting in "outpu"), and then typing "t" again. The full list of devices is then always retreived.

     

    Thank you!

  14. This is an amazing workflow. Saves me tons of clicks. Thank you!

     

    I've discovered 2 bugs:

     

    1. "Rename" opens "Item Info". If multiple files are selected, then instead of the "Rename x Items..." panel, the "Multiple Item Info" panel opens.

    2. "Get Info" doesn't work, neither for a single item nor for multiple.

     

    Thanks!

  15. Hello,

     

    I rely on Alfred exclusively for traversing my file system - opening files and folders with Finder, that is.

    The problem is that every new folder that I open - unless it already is - is opened in a new tab. Since I jump to and from my Mac's directories like a wild ferret, a simple browsing session results in dozens of Finder tabs.

    Is there ANY way to make folders open in a current/most recent Finder tab? This would be a real lifesaver.

    Path Finder behaves likes this out of the box and it's really nice, but the rest of that software is so buggy I couldn't use it anymore.

     

    Thanks!

     

×
×
  • Create New...