alfredapp / shortcuts-workflow

Run installed macOS shortcuts
BSD 3-Clause "New" or "Revised" License
247 stars 4 forks source link

All of a sudden cannot trigger workflow from alfred spotlight (sc) #13

Closed zyzzma closed 1 month ago

zyzzma commented 1 month ago

Workflow version

2024.2

Alfred version

5.5 [2257]

macOS version

14.5

Debugger output

[00:31:54.863] Logging Started...
[00:31:58.260] Shortcuts[Script Filter] Queuing argument '(null)'
[00:31:58.509] Shortcuts[Script Filter] Script with argv '(null)' finished
[00:31:58.516] ERROR: Shortcuts[Script Filter] Code 1: /Users/sergiopetisca/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/096D2E6E-CB63-43C2-B71D-A1FED8AB5049: execution error: Error: Error: Can't get object. (-1728)

More details

"sc" does not trigger the shortcut list, "scd" is fine

vitorgalvao commented 1 month ago

That’s a known bug with macOS. Reboot your Mac and you should be fine.

zyzzma commented 1 month ago

Hi Vitor,

Rebooted, Updated software (still on sonoma) and deleted spotlight v100 folder. Still there. Same error:

[15:29:47.053] Logging Started... [15:29:48.700] Shortcuts[Script Filter] Queuing argument '(null)' [15:29:48.943] Shortcuts[Script Filter] Script with argv '(null)' finished[15:29:48.949] ERROR: Shortcuts[Script Filter] Code 1: /Users/sergiopetisca/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/17B78288-98DA-4237-AC63-66E586BF075E: execution error: Error: Error: Can't get object. (-1728)

On Wednesday, August 7th, 2024 at 1:09 PM, Vítor Galvão @.***> wrote:

That’s a known bug with macOS. Reboot your Mac and you should be fine.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

vitorgalvao commented 1 month ago

Open Script Editor and change the language to JavaScript. Then run the following code. What is the result?

Application("Shortcuts Events").shortcuts()
zyzzma commented 1 month ago

Vitor, here:

[Application("Shortcuts Events").shortcuts.byName("New Shortcut 1"), Application("Shortcuts Events").shortcuts.byName("headphones"), Application("Shortcuts Events").shortcuts.byName("New Shortcut"), Application("Shortcuts Events").shortcuts.byName("Work Focus Off"), Application("Shortcuts Events").shortcuts.byName("Studio Off"), Application("Shortcuts Events").shortcuts.byName("Studio On"), Application("Shortcuts Events").shortcuts.byName("Office Off"), Application("Shortcuts Events").shortcuts.byName("Living Room Off"), Application("Shortcuts Events").shortcuts.byName("Living Room On"), Application("Shortcuts Events").shortcuts.byName("Shorten URL"), Application("Shortcuts Events").shortcuts.byName("Move Window"), Application("Shortcuts Events").shortcuts.byName("Toggle Hide Desktop"), Application("Shortcuts Events").shortcuts.byName("Start My Next Meeting"), Application("Shortcuts Events").shortcuts.byName("Coffeeshop"), Application("Shortcuts Events").shortcuts.byName("Shutdown"), Application("Shortcuts Events").shortcuts.byName("Open Work"), Application("Shortcuts Events").shortcuts.byName("Open Newsletter"), Application("Shortcuts Events").shortcuts.byName("Time Machine"), Application("Shortcuts Events").shortcuts.byName("Network Tool"), Application("Shortcuts Events").shortcuts.byName("Empty Downloads Folder"), Application("Shortcuts Events").shortcuts.byName("TinyURL"), Application("Shortcuts Events").shortcuts.byName("Office On"), Application("Shortcuts Events").shortcuts.byName("Home ETA"), Application("Shortcuts Events").shortcuts.byName("When To Leave"), Application("Shortcuts Events").shortcuts.byName("Amoreiras ETA"), Application("Shortcuts Events").shortcuts.byName("Get App Icon"), Application("Shortcuts Events").shortcuts.byName("Feed Cat"), Application("Shortcuts Events").shortcuts.byName("Recognize Music"), Application("Shortcuts Events").shortcuts.byName("Amazon Tracker"), Application("Shortcuts Events").shortcuts.byName("Location ETA"), Application("Shortcuts Events").shortcuts.byName("Main Action Button"), Application("Shortcuts Events").shortcuts.byName(">20% Battery"), Application("Shortcuts Events").shortcuts.byName("Other Focus Modes"), Application("Shortcuts Events").shortcuts.byName("Work Focus"), Application("Shortcuts Events").shortcuts.byName("Ikea Off"), Application("Shortcuts Events").shortcuts.byName("Ikea On"), Application("Shortcuts Events").shortcuts.byName("New Shortcut 5"), Application("Shortcuts Events").shortcuts.byName("Network Tool 1"), Application("Shortcuts Events").shortcuts.byName("Stop work"), Application("Shortcuts Events").shortcuts.byName("Create Task"), Application("Shortcuts Events").shortcuts.byName("Sl60 Off"), Application("Shortcuts Events").shortcuts.byName("Sl60 On"), Application("Shortcuts Events").shortcuts.byName("Treadmill"), Application("Shortcuts Events").shortcuts.byName("Control Aroeira"), Application("Shortcuts Events").shortcuts.byName("Run Upstairs Time"), Application("Shortcuts Events").shortcuts.byName("FT dad"), Application("Shortcuts Events").shortcuts.byName("FT mom"), Application("Shortcuts Events").shortcuts.byName("Music Finder"), Application("Shortcuts Events").shortcuts.byName("Open Fantastical on a Date"), Application("Shortcuts Events").shortcuts.byName("Shorten URL 2"), Application("Shortcuts Events").shortcuts.byName("Make PDF"), Application("Shortcuts Events").shortcuts.byName("Quick Launch - Open App"), Application("Shortcuts Events").shortcuts.byName("Search YouTube"), Application("Shortcuts Events").shortcuts.byName("Create Task 1"), Application("Shortcuts Events").shortcuts.byName("If 1"), Application("Shortcuts Events").shortcuts.byName("New Shortcut 2"), Application("Shortcuts Events").shortcuts.byName("New Shortcut 4"), Application("Shortcuts Events").shortcuts.byName("Network Tool 2"), Application("Shortcuts Events").shortcuts.byName("New Shortcut 1"), Application("Shortcuts Events").shortcuts.byName("New Shortcut 2"), Application("Shortcuts Events").shortcuts.byName("New Shortcut 3"), Application("Shortcuts Events").shortcuts.byName("New Shortcut 5"), Application("Shortcuts Events").shortcuts.byName("Travel Alarm"), Application("Shortcuts Events").shortcuts.byName("Master Action Button"), Application("Shortcuts Events").shortcuts.byName("Word Count"), Application("Shortcuts Events").shortcuts.byName("Open Editing"), Application("Shortcuts Events").shortcuts.byName("Open Scripting"), Application("Shortcuts Events").shortcuts.byName("Open Proxmox"), Application("Shortcuts Events").shortcuts.byName("Open Audiobook"), Application("Shortcuts Events").shortcuts.byName("Log Health Sample"), Application("Shortcuts Events").shortcuts.byName("Tip/Split/Pay"), Application("Shortcuts Events").shortcuts.byName("Tile Last 2 Windows"), Application("Shortcuts Events").shortcuts.byName("Meeting Coming up"), Application("Shortcuts Events").shortcuts.byName("count char"), Application("Shortcuts Events").shortcuts.byName("Clean up Downloads"), Application("Shortcuts Events").shortcuts.byName("Hiking"), Application("Shortcuts Events").shortcuts.byName("QR Wi-Fi"), Application("Shortcuts Events").shortcuts.byName("Join Zoom Meeting 2"), Application("Shortcuts Events").shortcuts.byName("Increment Count"), Application("Shortcuts Events").shortcuts.byName("When To Leave 2"), Application("Shortcuts Events").shortcuts.byName("Take a Break"), Application("Shortcuts Events").shortcuts.byName("Text Last Image"), Application("Shortcuts Events").shortcuts.byName("Make QR Code"), Application("Shortcuts Events").shortcuts.byName("Shazam shortcut"), Application("Shortcuts Events").shortcuts.byName("On The Spot"), Application("Shortcuts Events").shortcuts.byName("Travel"), Application("Shortcuts Events").shortcuts.byName("Relax"), Application("Shortcuts Events").shortcuts.byName("Workout"), Application("Shortcuts Events").shortcuts.byName("Work"), Application("Shortcuts Events").shortcuts.byName("Travel Focus"), Application("Shortcuts Events").shortcuts.byName("QR Your Wi-Fi"), Application("Shortcuts Events").shortcuts.byName("Wake Windows"), Application("Shortcuts Events").shortcuts.byName("Set Captions"), Application("Shortcuts Events").shortcuts.byName("Log weight"), Application("Shortcuts Events").shortcuts.byName("Rear"), Application("Shortcuts Events").shortcuts.byName("Frunk"), Application("Shortcuts Events").shortcuts.byName("Lock"), Application("Shortcuts Events").shortcuts.byName("Travel Mode"), Application("Shortcuts Events").shortcuts.byName("Do Not Disturb"), Application("Shortcuts Events").shortcuts.byName("Work Mode"), Application("Shortcuts Events").shortcuts.byName("Personal")]

On Wednesday, August 7th, 2024 at 4:43 PM, Vítor Galvão @.***> wrote:

Open Script Editor and change the language to JavaScript. Then run the following code. What is the result?

Application

(

"Shortcuts Events"

)

.

shortcuts

(

)

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

vitorgalvao commented 1 month ago

Now do:

var allShortcuts = Application("Shortcuts Events").shortcuts()

var sfItems = allShortcuts.map(shortcut => {
  const name = shortcut.name()
  const folder = shortcut.folder.exists() ? shortcut.folder.name() : ""

  console.log("name: " + name)
  console.log("folder: " + folder)

  return { name: name, folder: folder }
})

sfItems

If you get an error, click the image icon on the bottom, then make sure you are on the Replies tab, and run it again.

zyzzma commented 1 month ago

Can't get rid of this error:

app = Application("Shortcuts Events")

app.shortcuts()

--> [app.shortcuts.byName("New Shortcut 1"), app.shortcuts.byName("headphones"), app.shortcuts.byName("New Shortcut"), app.shortcuts.byName("Work Focus Off"), app.shortcuts.byName("Studio Off"), app.shortcuts.byName("Studio On"), app.shortcuts.byName("Office Off"), app.shortcuts.byName("Living Room Off"), app.shortcuts.byName("Living Room On"), app.shortcuts.byName("Shorten URL"), app.shortcuts.byName("Move Window"), app.shortcuts.byName("Toggle Hide Desktop"), app.shortcuts.byName("Start My Next Meeting"), app.shortcuts.byName("Coffeeshop"), app.shortcuts.byName("Shutdown"), app.shortcuts.byName("Open Work"), app.shortcuts.byName("Open Newsletter"), app.shortcuts.byName("Time Machine"), app.shortcuts.byName("Network Tool"), app.shortcuts.byName("Empty Downloads Folder"), app.shortcuts.byName("TinyURL"), app.shortcuts.byName("Office On"), app.shortcuts.byName("Home ETA"), app.shortcuts.byName("When To Leave"), app.shortcuts.byName("Amoreiras ETA"), app.shortcuts.byName("Get App Icon"), app.shortcuts.byName("Feed Cat"), app.shortcuts.byName("Recognize Music"), app.shortcuts.byName("Amazon Tracker"), app.shortcuts.byName("Location ETA"), app.shortcuts.byName("Main Action Button"), app.shortcuts.byName(">20% Battery"), app.shortcuts.byName("Other Focus Modes"), app.shortcuts.byName("Work Focus"), app.shortcuts.byName("Ikea Off"), app.shortcuts.byName("Ikea On"), app.shortcuts.byName("New Shortcut 5"), app.shortcuts.byName("Network Tool 1"), app.shortcuts.byName("Stop work"), app.shortcuts.byName("Create Task"), app.shortcuts.byName("Sl60 Off"), app.shortcuts.byName("Sl60 On"), app.shortcuts.byName("Treadmill"), app.shortcuts.byName("Control Aroeira"), app.shortcuts.byName("Run Upstairs Time"), app.shortcuts.byName("FT dad"), app.shortcuts.byName("FT mom"), app.shortcuts.byName("Music Finder"), app.shortcuts.byName("Open Fantastical on a Date"), app.shortcuts.byName("Shorten URL 2"), app.shortcuts.byName("Make PDF"), app.shortcuts.byName("Quick Launch - Open App"), app.shortcuts.byName("Search YouTube"), app.shortcuts.byName("Create Task 1"), app.shortcuts.byName("If 1"), app.shortcuts.byName("New Shortcut 2"), app.shortcuts.byName("New Shortcut 4"), app.shortcuts.byName("Network Tool 2"), app.shortcuts.byName("New Shortcut 1"), app.shortcuts.byName("New Shortcut 2"), app.shortcuts.byName("New Shortcut 3"), app.shortcuts.byName("New Shortcut 5"), app.shortcuts.byName("Travel Alarm"), app.shortcuts.byName("Master Action Button"), app.shortcuts.byName("Word Count"), app.shortcuts.byName("Open Editing"), app.shortcuts.byName("Open Scripting"), app.shortcuts.byName("Open Proxmox"), app.shortcuts.byName("Open Audiobook"), app.shortcuts.byName("Log Health Sample"), app.shortcuts.byName("Tip/Split/Pay"), app.shortcuts.byName("Tile Last 2 Windows"), app.shortcuts.byName("Meeting Coming up"), app.shortcuts.byName("count char"), app.shortcuts.byName("Clean up Downloads"), app.shortcuts.byName("Hiking"), app.shortcuts.byName("QR Wi-Fi"), app.shortcuts.byName("Join Zoom Meeting 2"), app.shortcuts.byName("Increment Count"), app.shortcuts.byName("When To Leave 2"), app.shortcuts.byName("Take a Break"), app.shortcuts.byName("Text Last Image"), app.shortcuts.byName("Make QR Code"), app.shortcuts.byName("Shazam shortcut"), app.shortcuts.byName("On The Spot"), app.shortcuts.byName("Travel"), app.shortcuts.byName("Relax"), app.shortcuts.byName("Workout"), app.shortcuts.byName("Work"), app.shortcuts.byName("Travel Focus"), app.shortcuts.byName("QR Your Wi-Fi"), app.shortcuts.byName("Wake Windows"), app.shortcuts.byName("Set Captions"), app.shortcuts.byName("Log weight"), app.shortcuts.byName("Rear"), app.shortcuts.byName("Frunk"), app.shortcuts.byName("Lock"), app.shortcuts.byName("Travel Mode"), app.shortcuts.byName("Do Not Disturb"), app.shortcuts.byName("Work Mode"), app.shortcuts.byName("Personal")]

app.shortcuts.byName("New Shortcut 1").name()

--> Error -1728: Can't get object.

Result:

Error -1728: Can't get object.

On Wednesday, August 7th, 2024 at 7:47 PM, Vítor Galvão @.***> wrote:

Now do:

var

allShortcuts

=

Application

(

"Shortcuts Events"

)

.

shortcuts

(

)

var

sfItems

=

allShortcuts

.

map

(

shortcut

=>

{

const

name

=

shortcut

.

name

(

)

const

folder

=

shortcut

.

folder

.

exists

(

)

?

shortcut

.

folder

.

name

(

)

:

""

console

.

log

(

"name: "

+

name

)

console

.

log

(

"folder: "

+

folder

)

return

{

name

:

name

,

folder

:

folder

}

}

)

sfItems

If you get an error, click the image.png (view on web) icon on the bottom, then make sure you are on the Replies tab, and run it again.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

vitorgalvao commented 1 month ago

You have at least two shortcuts with the same name (New Shortcut 1). Start by fixing that. The overall issue is somewhere in the Shortcuts app, so think back to what you did recently and check those.

zyzzma commented 1 month ago

Thanks Vitor, I fixed that, then re-ran the shortcut and it fixed it. They now have no folders but aside from that it's working. Thanks so much :)

On Wednesday, August 7th, 2024 at 11:04 PM, Vítor Galvão @.***> wrote:

You have at least two shortcuts with the same name (New Shortcut 1). Start by fixing that. The overall issue is somewhere in the Shortcuts app, so think back to what you did recently and check those.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>