Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/09/2021 in all areas

  1. Scriptability matters for Alfred Workflows, so this is a short thread on what we know about scriptability on the new macOS version. Discussion and new data is welcome; I’ll strive to keep this top post up to date with the most relevant information. Scripting languages might have survived another version: Shortcuts is coming to macOS, but it doesn’t mean the end of AppleScript yet: The Shortcuts app will scriptable, though the functionality isn’t yet available. It will also have a command-line tool: On June 8 there was a session going more in-depth into Shortcuts. Notable points: “We also added two new automation types for Focus and Sound Recognition”. “By the way, if your app integrates with file providers, these new Files actions will automatically work with the files that your app provides”. “We also have a new file format that lets you distribute Shortcuts as files“. (…) “This means that you can distribute your own Shortcuts on your website or in your app”. Which means we may be able to distribute Shortcuts as complements to Workflows. For M1 Macs, that may open a window to distribute everything needed to control iOS apps from Alfred. However, it’s unclear if we’ll need a ($99/year) Developer Account to distribute them in useful form, since they mention signing: “Shortcuts files are notarized by Apple to make sure they’re safe”. (…) “a new mode for sharing Shortcuts privately” (…) “Shortcuts files are signed with the identity of the person who sent them. If you need to re-sign a Shortcut, you can use the new Shortcuts command-line tool”. “Shortcuts has full support for AppleScripts and Shell Scripting”. Not dead yet! “Shortcuts is the future of Mac automation”. Taken in isolation; it’s a scary implication the other technologies are destined for the bin. But in context, they’re talking speficially about replacing Automator. “There’s a Shortcuts command-line tool which lets you list and run Shortcuts in your Shell Scripts or command-line tools”. “If you develop an app or a script that would benefit from the ability to run Shortcuts, you should use the Scripting interface. By communicating with the “Shortcuts Events” process, your app can get a list of shortcuts that the user has set up, as well as start running one. In AppleScript, you can accomplish this by telling the “Shortcuts Events” process to run a shortcut by name”: tell application "Shortcuts Events" run the shortcut named "Make GIF" end tell “Finally, macOS Monterey also includes a command-line tool that can list shortcuts and run them by name. If you have command-line tools or scripts, they can integrate with Shortcuts via this interface”. OVERVIEW: Command-line utility for running shortcuts. USAGE: shortcuts <command> OPTIONS: -h, --help Show help information. SUBCOMMANDS: run Run a shortcut. list List your shortcuts. view View a shortcut in Shortcuts. sign Sign a shortcut file. See 'shortcuts help <subcommand>' for detailed help.
    2 points
  2. Reading forum posts properly would save me some precious time! 🤦🏻‍♂️🤣
    1 point
  3. It's not the calling that takes the time, it's the importing.
    1 point
  4. So you’ve just updated to the new buggy shininess released by Apple. Congrats! But thread lightly. At all costs, you should avoid installing a beta macOS version on a machine with data you can’t afford to lose or waste a day resetting. In the course of your beta trial, you’ll bump into bugs and general issues. Some will be related to Alfred and Workflows, which will make you tempted to jump on this forum for help. Stop! Then wait. Ask yourself “is this a bug I should be reporting?” The closer to WWDC21, the likelier the answer is “no”. The overwhelming majority of bugs at this point will sort themselves out. And they are inconsistent. At the time of writing there have been two comments from users on the new macOS beta: one said Alfred worked, the other that it didn’t. At this point the new beta is so unstable we can’t even rely on a consistent experience between users, meaning no way to isolate and understand problems—effort spent in that direction wold be wasted. Avoid drowning the forum with unactionable bug reports. In general, if you don’t have enough knowledge or skill to figure out the cause of the problem, you should refrain from installing a beta OS. Please avoid filling but reports if that’s the case. Or file them at Apple, since it’s their end causing the breaks and giving them feedback is the point of installing their beta OS. So when should you start reporting general Alfred bugs? Look at the bug reports subforum. Do you see a “macOS 12.0 Monterey Bugs & Issues” section? If not, it’s too soon. What about Workflows? You should follow the same logic. If a Workflow stops working, either the developer will know because they are using the beta, or they won’t know and won’t be able to fix it anyway because they are not on the beta. There are exceptions to the above, but few. If you do make a bug report, please make sure to follow the instructions. Do that, and everyone will be more willing to look into your issue sooner and help get you sorted. Thank you. Have fun with the new features.
    1 point
  5. subprocess.check_output() is a bit simpler.
    1 point
  6. The workflow would be easier to use if you used workflow variables to set the text to add.
    1 point
  7. Those are two different themes, as far as Alfred is concerned: Alfred doesn't have a concept of theme variants. To set your light theme, choose an Alfred theme when the macOS colour scheme is light. To set your dark theme, choose a theme when macOS is in dark mode. Alfred will remember those choices and switch between them when the OS switches between light and dark modes.
    1 point
×
×
  • Create New...