Jump to content

SmartFolders: Browse and search the contents of your Saved Searches


Recommended Posts

Hi, thanks for your help! It worked after a restart. However, I have a saved search that looks for movies in a specific directory, but when I use your alfred workflow, it returns movies from anywhere on the disk. What would cause that?

 

 

Edit and re-save the Saved Search. That often seems to fix the problem.

 

I experience this problem as well, and the problem is not solved by edit and re-save. Any further ideas?

Link to comment
  • 1 month later...

OSX Version: 10.11.5

Alfred Build: V3.0.3 [694]

 

 

Hello! I am wondering if anyone else has had an issue with the Smart Folders Search for Alfred (https://github.com/d...ed-smartfolders) since updating to Alfred 3? It used to work fine and now it starts the script and falls back to the default search. After scrubbing through the forums I haven't been able to find anything on this. I opened up the debugger tool from Alfred and am not sure if I should paste it here (if that helps) but just thought to ask if anyone has had any issues/solutions? This occurs every time I run the workflow and is therefore now useless, unfortunately. I would love to remedy this as it was one of my most used workflows. 

 

Thanks so much for the great community and all ideas are welcome!

 

-- MSA

Link to comment

That's great deanishe, that was the fix I needed, very much appreciated. As you mention it's a really old workflow (but still works well for my needs), if you have any alternatives to other workflows I would be keen to hear as well. Thanks so much!

Link to comment

That's great deanishe, that was the fix I needed, very much appreciated. As you mention it's a really old workflow (but still works well for my needs), if you have any alternatives to other workflows I would be keen to hear as well. Thanks so much!

 

 

Hi msa - just want to check if that is all you did? Simply opened the alfred.py file, and replaced the two instances of Alfred 2/Alfred-2 to Alfred 3/Alfred-3 respectively?

 

Tried it this side, and unfortunately no go still. Opens in Finder, which is useful - but the "tab" option doesn't appear to do anything... 

Link to comment

Hi msa - just want to check if that is all you did? Simply opened the alfred.py file, and replaced the two instances of Alfred 2/Alfred-2 to Alfred 3/Alfred-3 respectively?

 

Tried it this side, and unfortunately no go still. Opens in Finder, which is useful - but the "tab" option doesn't appear to do anything... 

 

 

Hi Cassady - that is actually all I did to get it back on track. In the alfred.py file I changed the line from:

def work(volatile):    path = {
        True: '~/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data',
        False: '~/Library/Application Support/Alfred 2/Workflow Data'
    }[bool(volatile)]
    return _create(os.path.join(os.path.expanduser(path), bundleid))

to:

 

def work(volatile):
    path = {
        True: '~/Library/Caches/com.runningwithcrayons.Alfred-3/Workflow Data',
        False: '~/Library/Application Support/Alfred 3/Workflow Data'
    }[bool(volatile)]    return _create(os.path.join(os.path.expanduser(path), bundleid))

Before I made the changes I did re-download the workflow to ensure I had the correct version and no discrepancies on my part as well. It's interesting that yours does actually show up in finder because mine would literally fall straight back to the default search in Alfred. I didn't even make it to the finder. Hope this helps, I didn't realize how much I used it before.

Link to comment

 

Hi Cassady - that is actually all I did to get it back on track. In the alfred.py file I changed the line from:

def work(volatile):    path = {
        True: '~/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data',
        False: '~/Library/Application Support/Alfred 2/Workflow Data'
    }[bool(volatile)]
    return _create(os.path.join(os.path.expanduser(path), bundleid))

to:

 

def work(volatile):
    path = {
        True: '~/Library/Caches/com.runningwithcrayons.Alfred-3/Workflow Data',
        False: '~/Library/Application Support/Alfred 3/Workflow Data'
    }[bool(volatile)]    return _create(os.path.join(os.path.expanduser(path), bundleid))

Before I made the changes I did re-download the workflow to ensure I had the correct version and no discrepancies on my part as well. It's interesting that yours does actually show up in finder because mine would literally fall straight back to the default search in Alfred. I didn't even make it to the finder. Hope this helps, I didn't realize how much I used it before.

 

 

 

Aw shoot. Appreciate the prompt reply, and details - downloaded it today, and did indeed make the changes as you did, but without luck...

 

Unless it's actually working as it should?

When you have your Smart Folder option 'selected' after invoking Alfred >> .sf , and then hit 'Tab' - what happens exactly? 

 

Over here, hitting Tab sees the exact name of the Smart Folder getting added to the main Alfred search line, after .sf, followed by a single ">", as in 

.sf "name of smart folder" > 

Nothing really happens thereafter, despite me typing anything in an attempt to search, and hitting Enter, simply takes me back to Finder..., with the (weirdly) next Smart Folder option selected.

 

I presume this is not what is/was supposed to happen?

Link to comment

That is strange but at the same time that's what it does for me when I hit the tab key after selecting which smart folder I want to search in. However, in my screen below the Alfred search field you can view the files that are part of that smart folder's search criteria. I'm including a screen shot to show what comes up. 

 

Screen+Shot+2016-08-03+at+12.11.17+PM.pn

 

By doing this, if you keep typing it will drill down through that smart folder's contents. 

 

I remember reading in a forum before about editing the smart folder's search criteria (in Finder) and then re-saving it. That seemed to help a few others so I'd give that a try if you're not seeing the results respectively like the screen shot. If you figure it out, be sure to let us know, after scouring the forums trying to find the answer it really helps.

Edited by msa
Link to comment

That is strange but at the same time that's what it does for me when I hit the tab key after selecting which smart folder I want to search in. However, in my screen below the Alfred search field you can view the files that are part of that smart folder's search criteria. I'm including a screen shot to show what comes up. 

 

Screen+Shot+2016-08-03+at+12.11.17+PM.pn

 

By doing this, if you keep typing it will drill down through that smart folder's contents. 

 

I remember reading in a forum before about editing the smart folder's search criteria (in Finder) and then re-saving it. That seemed to help a few others so I'd give that a try if you're not seeing the results respectively like the screen shot. If you figure it out, be sure to let us know, after scouring the forums trying to find the answer it really helps.

 

 

Your screenshot explains what I'm missing. What a pity - that would have been really useful!

 

I've tried the edit and re-save, with no difference.

I'll reboot in a bit, maybe that will cause something to trigger.

 

Regardless, thanks for the assistance in trying to sort this out!  

Link to comment

What does Alfred's debugger say?

 

 

You've had me go and look, and now - in running tests - some things are starting to happen.

 

On my 'older' smart folders, created many years ago, the workflow is working as it should.

It hadn't occurred to me to check it on older folders, I was simply checking the two I created today. 

 

In ONE of the new smart folders, after several seconds following me pressing Tab, the 'hits' are revealed, but they are not the correct ones. 

 

By way of background - both of my smart folders are watching a specific Folder.

One is telling me what new (client) folders have been created in that Folder over the past month, the other is telling me which new documents have been created in that Folder.

The one watching for folders, when I press Tab - a list of folders that I have recently touched, but system-wide, is revealed. It is not the list of (client) folders created in that watched Folder.

The one watching for new documents, nothing triggers.

 

The long and short of it, is your workflow appears to be fine.

 

It's something this side that is tripping things up, and I don't want to have you go the effort of fixing something that's only because of problems my side!!

It might be due to the Smart Folder watching a specific folder (since all my other 'old' smart folders, are simply watching system-wide, for new PDFs; new Tags etc.), or not, and maybe a re-boot will fix things. 

 

Regardless, thanks for the query - but please, I don't want to cause any work for people kind enough to share their workflow creations!! 

Edited by Cassady
Link to comment

It might be due to the Smart Folder watching a specific folder (since all my other 'old' smart folders, are simply watching system-wide, for new PDFs; new Tags etc.), or not, and maybe a re-boot will fix things.

 

 

This is when re-saving the Smart Folder usually helps. It appears to be a general issue with Smart Folders, rather than the workflow.

 

FWIW, there's a bug in Python on OS X that can randomly lead to many Python scripts failing. If you're having intermittent failures, especially if it's affecting other workflows, too, it's probably the Python issue.

Link to comment
  • 1 month later...

Great workflow, thanks.

 

But TAB doesn't work for me also to browse/search within Smart Folders.

 

@Dean,

 

Thanks for the fix you sent me .

I tried it.

As Jono mentionned it, Tab is still not working  :(

 

 

FWIW, I'm pretty sure this was due to a (long-since fixed) bug in Alfred that caused it to hang if the debug log was too large. It affected you guys because you have so many Smart Folders…

Link to comment
  • 4 years later...

Hi @deanishe,

 

Just wanted to let you know since I saw some recent changes made to the source code in your repository, the workflow version 4.1 had a small issue displaying the ">" symbol. I suspect this have something to do with Font/Unicode (?) support.

 

Expected output (from v2.2)

1197525846_ScreenShot2021-02-05at06_13_52.png.4ab0df083a88e920b793c14208c6323f.png

 

Actual output (from v4.1)

245577853_ScreenShot2021-02-05at06_14_50.png.09ee6e442a6ef175af3fe118388f75a9.png

 

Regardless, I just found out about Smart Folder/Saved Searches from Alfred workflows and especially yours, so kudos and thank you for your works.

 

Cheers

Edited by WinstonNg
Link to comment
10 hours ago, WinstonNg said:

Actual output (from v4.1)

245577853_ScreenShot2021-02-05at06_14_50.png.09ee6e442a6ef175af3fe118388f75a9.png

 

 

The font you're using doesn't have a glyph for the Unicode character I'm using as a delimiter. You can either change your Alfred font to one with broader Unicode support, or edit the workflow to use a different delimiter. Some alternatives: (\U0000232A), (\U00003009).

Edited by deanishe
Link to comment
3 hours ago, deanishe said:

The font you're using doesn't have a glyph for the Unicode character I'm using as a delimiter. You can either change your Alfred font to one with broader Unicode support, or edit the workflow to use a different delimiter. Some alternatives: (\U0000232A), (\U00003009).

Thanks for the prompt response and I can confirm (\U00003009) worked on your latest version (v4.1) with system default font in Alfred, whereas (\U0000232A) will causing issues with the query, i.e. no matching Smart Folder.

Link to comment
  • 1 year later...
[10:08:19.135] Smart Folders[Script Filter] Queuing argument ''
[10:08:19.327] Smart Folders[Script Filter] Script with argv '' finished
[10:08:19.330] STDERR: Smart Folders[Script Filter] .
10:08:19 workflow.py:2061 DEBUG    ---------- Smart Folders (3.0.0) ----------
10:08:19 workflow.py:1468 DEBUG    reading settings from /Users/chumido/Library/Application Support/Alfred/Workflow Data/net.deanishe.alfred-smartfolders/settings.json
10:08:19 workflow.py:1468 DEBUG    reading settings from /Users/chumido/Library/Application Support/Alfred/Workflow Data/net.deanishe.alfred-smartfolders/settings.json
10:08:19 workflow.py:2338 INFO     checking for update ...
10:08:19 background.py:230 DEBUG    [__workflow_update_check] command cached: /Users/chumido/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/net.deanishe.alfred-smartfolders/__workflow_update_check.argcache
10:08:19 background.py:234 DEBUG    [__workflow_update_check] passing job to background runner: [u'/usr/bin/python', '/Users/chumido/Dropbox/AppData/Alfred/Alfred/Alfred.alfredpreferences/workflows/user.workflow.EF46720C-544C-41D1-AC8D-AECE4C55568F/workflow/background.pyc', u'__workflow_update_check']
10:08:19 workflow.py:2080 ERROR    [Errno 2] No such file or directory
Traceback (most recent call last):
  File "/Users/chumido/Dropbox/AppData/Alfred/Alfred/Alfred.alfredpreferences/workflows/user.workflow.EF46720C-544C-41D1-AC8D-AECE4C55568F/workflow/workflow.py", line 2070, in run
    self.check_update()
  File "/Users/chumido/Dropbox/AppData/Alfred/Alfred/Alfred.alfredpreferences/workflows/user.workflow.EF46720C-544C-41D1-AC8D-AECE4C55568F/workflow/workflow.py", line 2340, in check_update
    run_in_background('__workflow_update_check', cmd)
  File "/Users/chumido/Dropbox/AppData/Alfred/Alfred/Alfred.alfredpreferences/workflows/user.workflow.EF46720C-544C-41D1-AC8D-AECE4C55568F/workflow/background.py", line 235, in run_in_background
    retcode = subprocess.call(cmd)
  File "/Users/chumido/.pyenv/versions/2.7.18/lib/python2.7/subprocess.py", line 172, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/Users/chumido/.pyenv/versions/2.7.18/lib/python2.7/subprocess.py", line 394, in __init__
    errread, errwrite)
  File "/Users/chumido/.pyenv/versions/2.7.18/lib/python2.7/subprocess.py", line 1047, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
10:08:19 workflow.py:2103 DEBUG    ---------- finished in 0.029s ----------
[10:08:19.332] Smart Folders[Script Filter] {
  "items": [
    {
      "valid": false,
      "subtitle": "[Errno 2] No such file or directory",
      "icon": {
        "path": "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertStopIcon.icns"
      },
      "title": "Error in workflow 'Smart Folders'"
    }
  ]
}

 

i change in script to

/usr/local/bin/python smartfolders.py "$1"

 

@deanishe Can you have me fix this?

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...