Jump to content

MTG Card Search — Search for Magic: The Gathering playing cards


vitor

Recommended Posts

Usage


Search for Magic: The Gathering cards via the mtg keyword.


mtg.png

  • ↩ View card in Alfred. Press again to return to list.
  • ⇧↩ Open on Scryfall.
  • ⌥↩ Copy Scryfall URL. Subsequent triggers append to the list.
  • ⌃↩ Copy card name. Subsequent triggers append to the list.
  • ⌘↩ Add to history. Happens automatically when opening a card.
  • ⌘Y (or tap ⇧) Quick Look the front face.

imageview.png


Search opened card history with the mtghis keyword.


mtghis.png


gridview.png


The same shortcuts as above apply.


⤓ Install on the Alfred Gallery | Source

Link to comment

When reporting issues, please include your exact installed versions of:

  • The Workflow.
  • Alfred.
  • macOS.

In addition to:

  • The debugger output. Perform the failing action, click “Copy” on the top right and paste it here.
  • Details on what you did, what happened, and what you expected to happen. A short video of the steps with the debugger open may help to find the problem faster.

Thank you. Accurate and thorough information is crucial for a proper diagnosis which allows me to help you better.

Link to comment
  • 11 months later...
16 minutes ago, nikivi said:

Hope it’s not too off topic.

 

Considering that since its inception this Workflow has only supported a single game, I’d say it’s on topic!

 

16 minutes ago, nikivi said:

do you play magic: the gathering online?

 

Nope. Even if I wanted to, don’t you need Windows for that?

Link to comment
  • 4 months later...

Update.

  • Removed option to search non-english names.
  • Faster to search for cards, because it now downloads and saves the entire database.
  • Faster to display quicklook cards because it defaults to a lower-quality (but still pretty good) preview image.
  • Displays mana colours in icons.


To update, download the latest version (same URL) or wait a few days and it’ll prompt you to on next usage, since it uses OneUpdater.
 

Link to comment
  • 5 months later...

I haven't been able to get this to work.  Whenever it tries to rebuild it returns with the notification: "Error rebuilding card database"

 

Console had a lot to say.

The first error was:

cannot open file at line 42270 of [95fbac39ba]
error    13:42:01.909680 -0400    applet    os_unix.c:42270: (2) open(/var/db/DetachedSignatures) - No such file or directory

 

Googling indicates it's becoming common for the DetachedSignatures file to be missing, so I touched one to create it.

 

Next it was missing a "PlugIns" folder in the Notifier app bundle:

lsd    Non-fatal error enumerating at <private>, continuing: Error Domain=NSCocoaErrorDomain Code=260 "The file “PlugIns” couldn’t be opened because there is no such file." UserInfo={NSURL=PlugIns/ -- file:///Users/<myusername>/Library/Application%20Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.9933E1BC-1B62-4C77-8EB5-61CAB19EDCF2/Notificator.app/Contents/, NSFilePath=/Users/<myusername>/Library/Application Support/Alfred/Alfred.alfredpreferences/workflows/user.workflow.9933E1BC-1B62-4C77-8EB5-61CAB19EDCF2/Notificator.app/Contents/PlugIns, NSUnderlyingError=0x7ff04b4018f0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}

 

So I created that directory, but alas it still won't run.

 

I think I'm hung up on this part of the console error:

 

default    14:01:22.605260 -0400    distnoted    register name: com.apple.nsquiet_safe_quit_give_reason object: com.vitorgalvao.alfred.cardsearch token: f4270 pid: 38070
default    14:01:22.689067 -0400    tccd    -[TCCDAccessIdentity staticCode]: static code for: identifier com.runningwithcrayons.Alfred, type: 0: 0x7f92abe0e9a0 at /Applications/Alfred 4.app
default    14:01:22.816648 -0400    applet            OSErr AERemoveEventHandler(AEEventClass, AEEventID, AEEventHandlerUPP, Boolean)(ascr,gdut handler=0x7fff44251005 isSys=YES) err=0/noErr
default    14:01:22.817321 -0400    applet    self-sent 'ascr'/'gdut' event accepted in process that isn't scriptable
default    14:01:22.820976 -0400    applet    UNIX error exception: 17
default    14:01:22.825030 -0400    applet    UNIX error exception: 17
default    14:01:22.830357 -0400    applet    UNIX error exception: 17
 

I did notice that the Alfred script for the :mtgrebuild keyword has "./build_cards_json", but the executable is named "./build_mtg_cards_json", (Notice the missing _mtg in the first string).  I added that, and it now takes much longer before it fails, but it does still fail with the error above.

 

Trying to run build_mtg_cards_json directly from terminal results in:

$ ./build_mtg_cards_json

./build_mtg_cards_json:6:in `join': no implicit conversion of nil into String (TypeError)

from ./build_mtg_cards_json:6:in `<main>'

 

But I don't know if that should work standalone or not.

Link to comment

I set the environment variables trying to get a little further, and hit this error:

 

$ ./build_mtg_cards_json

./build_mtg_cards_json:24:in `block in <main>': undefined method `empty?' for nil:NilClass (NoMethodError)

from ./build_mtg_cards_json:13:in `each'

from ./build_mtg_cards_json:13:in `<main>'

Link to comment
1 minute ago, DieselDM said:

I set the environment variables trying to get a little further, and hit this error:

 

$ ./build_mtg_cards_json

 

If you set a Workflow Environment Variable inside Alfred but then run the tool outside Alfred, it makes no difference.


The problem has been fixed; update to the latest version. The introduction of Art Series cards was the issue. The Workflow now ignores them, as it already did tokens.

Link to comment
4 hours ago, vitor said:

 

If you set a Workflow Environment Variable inside Alfred but then run the tool outside Alfred, it makes no difference.


The problem has been fixed; update to the latest version. The introduction of Art Series cards was the issue. The Workflow now ignores them, as it already did tokens.

I had set it in the terminal where I was trying to run the binary.

 

The latest version does indeed work.  Thanks!

Link to comment
  • 7 months later...
  • 2 months later...
  • 3 weeks later...
  • vitor changed the title to MTG Card Search — Search for Magic: The Gathering playing cards
  • 1 month later...
  • 1 month later...

Updated to 2024.1.

  • Preview cards directly in Alfred, with easy open and close (↩ for both).
  • Add new mtghis command to see list of previously opened cards with Grid View.
  • Shortcuts to copy Scryfall URL or Card Name. Using them multiple times appends to the list, allowing for quick construction.
  • Changed most shortcuts to accomodate the new options.
  • Faster cache method.
  • Removed option for image size and rarity sorting.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...