Jump to content

Sorehead

Member
  • Posts

    8
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Sorehead's Achievements

Helping Hand

Helping Hand (3/5)

0

Reputation

  1. Hi - love this workflow. After entering keyword the workflow no longer lists messages in Alfred; it now opens the Messages app. Any others experiencing similar issue? Ventura 13.3.1 (a)
  2. I'm not a programmer and don't understand how to use an apple script in Alfred. Could someone explain?
  3. vitor, you solved my problem! Thank you so much
  4. Wow, you're fast, vitor. I appreciate your time and effort in helping me, sincerely. I removed the two lines of code you directed me to erase. The workflow still isn't working. I ran Alfred's Debugger and received the following...any thoughts? [19:30:16.056] Logging Started... [19:30:16.724] Keyboard Brightness[Hotkey] Processing complete [19:30:16.735] Keyboard Brightness[Hotkey] Passing output 'keyboard-brightness-up' to Run Script [19:30:16.866] ERROR: Keyboard Brightness[Run Script] /Users/Sorehead/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/E06D20DF-E0EE-4C54-83BB-6E0A4C5614DB:15:17: error: cannot find 'NSEvent' in scope let flags = NSEvent.ModifierFlags(rawValue: (down ? 0xa00 : 0xb00)) ^~~~~~~ /Users/Sorehead/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/E06D20DF-E0EE-4C54-83BB-6E0A4C5614DB:17:14: error: cannot find 'NSEvent' in scope let ev = NSEvent.otherEvent( ^~~~~~~ /Users/Sorehead/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/E06D20DF-E0EE-4C54-83BB-6E0A4C5614DB:18:13: error: cannot find 'NSEvent' in scope with: NSEvent.EventType.systemDefined, ^~~~~~~ /Users/Sorehead/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/E06D20DF-E0EE-4C54-83BB-6E0A4C5614DB:19:17: error: cannot find 'NSPoint' in scope location: NSPoint(x: 0, y: 0), ^~~~~~~ /Users/Sorehead/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/E06D20DF-E0EE-4C54-83BB-6E0A4C5614DB:23:16: error: 'nil' requires a contextual type context: nil, ^ /Users/Sorehead/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/E06D20DF-E0EE-4C54-83BB-6E0A4C5614DB:28:19: error: type of expression is ambiguous without more context let cev = ev?.cgEvent ~~~~^~~~~~~ /Users/Sorehead/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/E06D20DF-E0EE-4C54-83BB-6E0A4C5614DB:29:20: error: cannot find 'CGEventTapLocation' in scope cev?.post(tap: CGEventTapLocation.cgSessionEventTap) ^~~~~~~~~~~~~~~~~~ [19:30:20.181] Logging Stopped.
  5. Thanks for the quick response, vitor. I think I did what your instructions describe, but the keyboard brightness is not increasing. In fact, I don't think anything happens. Before trying the Workflow, I set my keyboard brightness to no brightness, then tried to increase brightness using my Hotkey. I entered the Command-1 Hotkey several times. I also tried holding Command-1 down for a long time. Neither works. Could you look at the attached pictures and the code I'm using to see what might be wrong? If important, I'm using Ventura 13.3.1 on MBP 16-in 2021. And here's the code I'm running: var query = CommandLine.arguments[1] print(query, terminator: "")import Quartz let supportedKeys: [String: UInt32] = [ "screen-brightness-up": 2, "screen-brightness-down": 3, "keyboard-brightness-up": 21, "keyboard-brightness-down": 22, "play-pause": 16, "fast-forward": 17, "rewind": 18, "volume-mute-toggle": 7, "volume-up": 0, "volume-down": 1, ] func pressKey(_ key: UInt32) { func keyDown(_ down: Bool) { let flags = NSEvent.ModifierFlags(rawValue: (down ? 0xa00 : 0xb00)) let data1 = Int((key << 16) | (down ? 0xa00 : 0xb00)) let ev = NSEvent.otherEvent( with: NSEvent.EventType.systemDefined, location: NSPoint(x: 0, y: 0), modifierFlags: flags, timestamp: 0, windowNumber: 0, context: nil, subtype: 8, data1: data1, data2: -1 ) let cev = ev?.cgEvent cev?.post(tap: CGEventTapLocation.cgSessionEventTap) } keyDown(true) keyDown(false) } pressKey(supportedKeys[CommandLine.arguments[1]]!)
  6. Does anyone know of a workflow we can use to adjust keyboard brightness manually? Looking to use hotkeys to adjust instead of clicking my way through Apple menus.
  7. I've worked in academia for several years and just discovered this workflow - it's incredible. Thanks.
×
×
  • Create New...