aoshevnev Posted May 8, 2013 Share Posted May 8, 2013 (edited) Your screenshot is a bit too small for me to read, but it looks like it's working fine. Where are you seeing a problem? It does not work The task does not fall into inbox Edited May 8, 2013 by Alеx Link to comment
phyllisstein Posted May 8, 2013 Author Share Posted May 8, 2013 Okay, the first thing to bear in mind is that there was literally no way for me to determine that from your screenshot. It's not at all helpful to say that something doesn't work without explaining what doesn't work and how it doesn't work. That said, it's possible that the error is an AppleScript problem. It's tended to choke on UTF-8 characters in the past. In that case, it'd be out of my control. You need to change the script action to read python act.py {query} 2>&1 | tee act.log and post the contents of act.log, from the workflow's folder. If there's an error there, I might be able to do something about it. Link to comment
aoshevnev Posted May 8, 2013 Share Posted May 8, 2013 (edited) Okay, the first thing to bear in mind is that there was literally no way for me to determine that from your screenshot. It's not at all helpful to say that something doesn't work without explaining what doesn't work and how it doesn't work. That said, it's possible that the error is an AppleScript problem. It's tended to choke on UTF-8 characters in the past. In that case, it'd be out of my control. You need to change the script action to read python act.py {query} 2>&1 | tee act.log and post the contents of act.log, from the workflow's folder. If there's an error there, I might be able to do something about it. act.log: Traceback (most recent call last): File "act.py", line 48, in <module> process() File "act.py", line 36, in process o = check_output(["osascript", "-e", scpt("parse quicksilver input \"{0}\"".format(inp))]) UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-6: ordinal not in range(128) I added .encode('utf-8') in 36 line and it worked o = check_output(["osascript", "-e", scpt("parse quicksilver input \"{0}\"".format(inp.encode('utf-8')))]) Perhaps problem was in python 2.7.x Thanks for help (: Edited May 8, 2013 by Alеx Link to comment
phyllisstein Posted May 8, 2013 Author Share Posted May 8, 2013 Thanks; I changed the version on my server to reflect that, and added encode() statements to the other places where the input showed up. Hopefully that'll hold it for a while. Thanks for your help! Link to comment
aoshevnev Posted May 9, 2013 Share Posted May 9, 2013 (edited) Thanks; I changed the version on my server to reflect that, and added encode() statements to the other places where the input showed up. Hopefully that'll hold it for a while. Thanks for your help! In the new version, I get error again: Traceback (most recent call last): File "act.py", line 48, in <module> process() File "act.py", line 36, in process o = check_output(["osascript", "-e", scpt("parse quicksilver input \"{0}\"".format(inp.encode("utf-8")))]) File "act.py", line 10, in scpt end tell'''.format(innards) UnicodeDecodeError: 'ascii' codec can't decode byte 0xd1 in position 25: ordinal not in range(128) You can add .decode("utf-8") at 10 and 19(?) lines to resolve it end tell'''.format(innards.decode("utf-8")) And you made a typo in line 43, so choice of areas and projects will not work o = check_output(["osascript", "-e", scpt_act("show ({0} named \"{1}\")".format(thing.encode("utf-8", inp.encode("utf-8"))))]) o = check_output(["osascript", "-e", scpt_act("show ({0} named \"{1}\")".format(thing.encode("utf-8"), inp.encode("utf-8")))]) Edited May 9, 2013 by Alеx Link to comment
phyllisstein Posted May 9, 2013 Author Share Posted May 9, 2013 Good catch. I've made that change as well. Unicode encoding and decoding gives me a greasy headache, and accounts for the vast majority of the bugs I leave lying around in my projects; I appreciate the help! Link to comment
imurban Posted May 23, 2013 Share Posted May 23, 2013 I cannot get this to trigger at all. Is there some configuration of Things or Alfred that I'm overlooking (I scanned this thread's post history as best I could)? Any help would be greatly appreciated. Link to comment
phyllisstein Posted May 23, 2013 Author Share Posted May 23, 2013 Can you please check the workflow folder for a file called "feedback.log" and post its contents? Link to comment
imurban Posted May 29, 2013 Share Posted May 29, 2013 Perhaps I have bigger problems: I can't find a "feedback.log" file or any other file in that location (Dropbox) What am I missing here? Link to comment
phyllisstein Posted May 29, 2013 Author Share Posted May 29, 2013 Yes. Please right-click on the name of the workflow in your preferences and click "Show in Finder." The file should be in the folder that pops up. Also, I don't know what that "Extensions" folder is about—the workflows are stored in the package Alfred.alfredpreferences. Just a heads-up. Link to comment
imurban Posted May 29, 2013 Share Posted May 29, 2013 Thank you for the direction; I've included the code below. The "extensions" folder may have inadvertently been created from my first attempts at migrating from Alfred v1. ------------------------------------------------------- <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>bundleid</key> <string>com.danielsh.alfred.things</string> <key>connections</key> <dict> <key>3EEF5217-86CB-42AB-AE8A-42B54B672E82</key> <array> <dict> <key>destinationuid</key> <string>AB86BAFD-6FE7-443D-9DE9-0DD80667FB1E</string> <key>modifiers</key> <integer>0</integer> <key>modifiersubtext</key> <string></string> </dict> </array> <key>AB86BAFD-6FE7-443D-9DE9-0DD80667FB1E</key> <array/> </dict> <key>createdby</key> <string>Daniel Shannon</string> <key>description</key> <string>Search and add to-dos.</string> <key>disabled</key> <false/> <key>name</key> <string>Things</string> <key>objects</key> <array> <dict> <key>config</key> <dict> <key>escaping</key> <integer>0</integer> <key>script</key> <string>python act.py {query} 2>&1 | tee act.log</string> <key>type</key> <integer>0</integer> </dict> <key>type</key> <string>alfred.workflow.action.script</string> <key>uid</key> <string>AB86BAFD-6FE7-443D-9DE9-0DD80667FB1E</string> </dict> <dict> <key>config</key> <dict> <key>argumenttype</key> <integer>1</integer> <key>escaping</key> <integer>4</integer> <key>keyword</key> <string>things</string> <key>script</key> <string>python feedback.py "{query}" 2>&1 | tee feedback.log</string> <key>subtext</key> <string>Search, add, or edit Things tasks.</string> <key>title</key> <string>Things Tasks</string> <key>type</key> <integer>0</integer> <key>withspace</key> <true/> </dict> <key>type</key> <string>alfred.workflow.input.scriptfilter</string> <key>uid</key> <string>3EEF5217-86CB-42AB-AE8A-42B54B672E82</string> </dict> </array> <key>readme</key> <string></string> <key>uidata</key> <dict> <key>3EEF5217-86CB-42AB-AE8A-42B54B672E82</key> <dict> <key>ypos</key> <real>190</real> </dict> <key>AB86BAFD-6FE7-443D-9DE9-0DD80667FB1E</key> <dict> <key>ypos</key> <real>190</real> </dict> </dict> <key>webaddress</key> <string>http://alfred.daniel.sh</string> </dict> </plist> Link to comment
phyllisstein Posted May 29, 2013 Author Share Posted May 29, 2013 That's "info.plist." I need something called "feedback.log." Link to comment
imurban Posted May 29, 2013 Share Posted May 29, 2013 Sorry, that was careless of me. Here's the right stuff: Traceback (most recent call last): File "feedback.py", line 126, in <module> do_feedback() File "feedback.py", line 56, in do_feedback things_data = do_things_dump() File "feedback.py", line 18, in do_things_dump shutil.copyfile(libpath, target) File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/shutil.py", line 52, in copyfile IOError: [Errno 2] No such file or directory: '/Users/graphics/Library/Application Support/Cultured Code/Things/ThingsLibrary.db' Link to comment
phyllisstein Posted May 30, 2013 Author Share Posted May 30, 2013 No problem. What that seems to suggest is that your Things library is neither in the sandboxed container nor in the unsandboxed Library. How did you install Things? Link to comment
imurban Posted May 30, 2013 Share Posted May 30, 2013 All of my ".thingsitem" files reside in: /Users/graphics/Library/Caches/Metadata/com.culturedcode.things/Things My actual "ThingsLibrary.db" file resides in: /Users/graphics/Dropbox/AppPresets/Things Link to comment
imurban Posted May 30, 2013 Share Posted May 30, 2013 Actually, no. Scratch that. That Dropbox stuff was a Hazel-generated backup. The operating library file was in: /Users/graphics/Library/Application Support/Cultured Code/Things except I had renamed the folder to "Things_miad" in order to differentiate between two different library folders I had setup for Things and Thing Beta (when Things cloud sync was first being tested). I've just now reverted to the proper name, and I'm pointing Things to the amended folder path. Link to comment
imurban Posted May 30, 2013 Share Posted May 30, 2013 Somewhat improved results: the workflow displays everything and very quickly, but nothing happens when I hit Enter on any item, nor can I type a unique task that shows up in Things. I understand there may be a few different builds of this workflow. Which would you most recommend? "act.log": ------------------------------------------------------- Traceback (most recent call last): File "act.py", line 2, in <module> from subprocess import check_output ImportError: cannot import name check_output ------------------------------------------------------- "feedback.log": ------------------------------------------------------- <items><item arg="parse "test"" uid="com.danielsh.alfred.things.600126875380" valid="yes"><icon>icon.png</icon><subtitle>test</subtitle><title>Add Task</title></item><item arg="show "to do" "test in browser"" uid="task-test" valid="yes"><icon>/Users/graphics/Dropbox/AppPresets/Alfred v2/Alfred.alfredpreferences/workflows/user.workflow.8BF31F9A-5EC8-4203-BC90-85EA313496F4/images/check.png</icon><subtitle /><title>test in browser</title></item><item arg="show "to do" "testing Things cloud sync "" uid="task-testing" valid="yes"><icon>/Users/graphics/Dropbox/AppPresets/Alfred v2/Alfred.alfredpreferences/workflows/user.workflow.8BF31F9A-5EC8-4203-BC90-85EA313496F4/images/check.png</icon><subtitle /><title>testing Things cloud sync </title></item><item arg="show "to do" "test out Scapple"" uid="task-test" valid="yes"><icon>/Users/graphics/Dropbox/AppPresets/Alfred v2/Alfred.alfredpreferences/workflows/user.workflow.8BF31F9A-5EC8-4203-BC90-85EA313496F4/images/check.png</icon><subtitle /><title>test out Scapple</title></item><item arg="show "to do" "test egg"" uid="task-test" valid="yes"><icon>/Users/graphics/Dropbox/AppPresets/Alfred v2/Alfred.alfredpreferences/workflows/user.workflow.8BF31F9A-5EC8-4203-BC90-85EA313496F4/images/check.png</icon><subtitle /><title>test egg</title></item><item arg="show "to do" "test in browser"" uid="task-test" valid="yes"><icon>/Users/graphics/Dropbox/AppPresets/Alfred v2/Alfred.alfredpreferences/workflows/user.workflow.8BF31F9A-5EC8-4203-BC90-85EA313496F4/images/check.png</icon><subtitle /><title>test in browser</title></item><item arg="show "to do" "test in browser"" uid="task-test" valid="yes"><icon>/Users/graphics/Dropbox/AppPresets/Alfred v2/Alfred.alfredpreferences/workflows/user.workflow.8BF31F9A-5EC8-4203-BC90-85EA313496F4/images/check.png</icon><subtitle /><title>test in browser</title></item><item arg="show "to do" "ask Sister Louise Marie for access to latest newsletters"" uid="task-ask" valid="yes"><icon>/Users/graphics/Dropbox/AppPresets/Alfred v2/Alfred.alfredpreferences/workflows/user.workflow.8BF31F9A-5EC8-4203-BC90-85EA313496F4/images/check.png</icon><subtitle /><title>ask Sister Louise Marie for access to latest newsletters</title></item><item arg="show "to do" "print to encrypt sensitive Evernotes"" uid="task-print" valid="yes"><icon>/Users/graphics/Dropbox/AppPresets/Alfred v2/Alfred.alfredpreferences/workflows/user.workflow.8BF31F9A-5EC8-4203-BC90-85EA313496F4/images/check.png</icon><subtitle /><title>print to encrypt sensitive Evernotes</title></item><item arg="show "to do" "call to get Due Dates for remaining Lawn & Garden Retailer advertisements"" uid="task-call" valid="yes"><icon>/Users/graphics/Dropbox/AppPresets/Alfred v2/Alfred.alfredpreferences/workflows/user.workflow.8BF31F9A-5EC8-4203-BC90-85EA313496F4/images/check.png</icon><subtitle /><title>call to get Due Dates for remaining Lawn & Garden Retailer advertisements</title></item><item arg="show "to do" "print to encrypt sensitive Evernotes"" uid="task-print" valid="yes"><icon>/Users/graphics/Dropbox/AppPresets/Alfred v2/Alfred.alfredpreferences/workflows/user.workflow.8BF31F9A-5EC8-4203-BC90-85EA313496F4/images/check.png</icon><subtitle /><title>print to encrypt sensitive Evernotes</title></item><item arg="show "to do" "print to encrypt sensitive Evernotes"" uid="task-print" valid="yes"><icon>/Users/graphics/Dropbox/AppPresets/Alfred v2/Alfred.alfredpreferences/workflows/user.workflow.8BF31F9A-5EC8-4203-BC90-85EA313496F4/images/check.png</icon><subtitle /><title>print to encrypt sensitive Evernotes</title></item></items> Link to comment
phyllisstein Posted May 30, 2013 Author Share Posted May 30, 2013 I take it you're running an older version of Mac OS X? The version just pushed to http://alfred.daniel.sh/Workflows/Things.alfredworkflow and Alleyoop should solve the problem. Link to comment
imurban Posted May 30, 2013 Share Posted May 30, 2013 Yes, I'm on Snow Leopard. Thank you for the latest workflow version. I've installed and also run Alleyoop on it to be doubly sure, but to no avail. I get a full library readout but still cannot add a task. For instance, from this point in the screenshot, hitting Enter closes Alfred's entry window, nothing more. I would really love for this to work. Did my log data indicate anything amiss? Link to comment
phyllisstein Posted May 30, 2013 Author Share Posted May 30, 2013 Apologies: I missed a call to check_output, which was causing the problem in the first place. I didn't realize when I wrote this and another workflow that Snow Leopard shipped with Python 2.6 and that method was added in Python 2.7. Try downloading it now and it should work fine. Link to comment
imurban Posted May 30, 2013 Share Posted May 30, 2013 Thank you, thank you! Works like a charm. Really generous of you to put all this time into fixing for my setup (and others', I expect). Between this and TexExpander, I'm assigning my little Unicode characters tags and filing tasks to Areas at lightning speed! Link to comment
phyllisstein Posted May 30, 2013 Author Share Posted May 30, 2013 Hah, excellent, I'm glad we got it working. No problem at all. Link to comment
bmscmoreira Posted June 6, 2013 Share Posted June 6, 2013 (edited) Thanks for the effort Daniel... so many requests (and here comes one more!) - I am experiencing "cropped" tasks... when adding a new task via alfred, not all text is passed to things. I've tried several tests but still not able to figure out a pattern! Somethings last character is cropped, other times the last 2, sometimes nothing is cropped. Seem not to have to do with the lenght of the text. How can I help identify the problem? Nevermind. I have to be patient! If I write too quickly and hit enter before all text appears in Alfred's window, then it is cropped! Edited June 6, 2013 by bmscmoreira Link to comment
phyllisstein Posted June 6, 2013 Author Share Posted June 6, 2013 Glad it worked itself out! Yeah, I'm afraid that the script is still a bit sluggish, and I can see why that would happen. If you know that you're going to add a task, you might have better luck prepending a plus sign: if the script detects that the query starts with "+", it skips the more work-intensive data extraction and searching. But I'm going to take a look at its innards right now and see if I can't find another way to speed it up a bit. Link to comment
Davide Posted June 11, 2013 Share Posted June 11, 2013 (edited) Unfortunately, the >+0 syntax is the only way to do it. That syntax is built into Things, and the challenges required for injecting tasks any other way have so far struck me as insurmountable. If I can find a way to make it easier, I'll definitely change it; but for now, that's all you've got. If I use >+0 Things crashes immediately, tried it several times. I use Things 2.2.1, Alfred 2.0.4 with Mac OS 10.8.4. Edited June 11, 2013 by Davide Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now