Jump to content

Wikify (Evernote Wiki-Helper)


Recommended Posts

Thank you for the guidance,

 

One note selected, 400 words,

 

Wrt, "Maybe run Alfred debugger with ensel as well." I take it this is different from running the debugger for: Starting debug for 'Wikify', please advise,

 

Thanks

Link to comment

You have 400 words selected? Or there are 400 words in the note. The ensel command will create a new Evernote the title of which will be the selected text, so selecting 400 words would def crash Evernote.

As to the debugger. It will capture all data for a workflow. So just open Alfred, go to Wikify and start the debugger. Then just run the workflow as normal. In this case, that means going to Evernote, selecting text, then opening Alfred and using the ensel keyword.

Link to comment

Great idea of workflow. 

 

I'm trying to convert evernote note to md format, but it doesn't want to work. 

 

So I have note on evernote, it is open, it is selected

And when I write command "enmd" - debugger says me that:

Starting debug for 'Wikify'

[ERROR: alfred.workflow.action.script] Code 1: en2md.scpt: execution error: Traceback (most recent call last):
  File "/Users/uvaroff/Documents/Dropbox/alfred_settings_june/Alfred.alfredpreferences/workflows/user.workflow.B41135A6-FB94-4472-ABE6-D43893656DBF/dependencies/html2text.py", line 914, in <module>
    main()
  File "/Users/uvaroff/Documents/Dropbox/alfred_settings_june/Alfred.alfredpreferences/workflows/user.workflow.B41135A6-FB94-4472-ABE6-D43893656DBF/dependencies/html2text.py", line 883, in main
    data = open(file_, 'rb').read()
IOError: [Errno 2] No such file or directory: '/Users/uvaroff/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data/com.hackademic.wikify/Auction yandex direct.html' (1)

Do you happen to have an idea what is wrong here? 

Is it possible that the problem is in Russian? 

Link to comment

Hmm...That's strange. What version of Wikify do you have? Could you share the Evernote note with me that caused the crash? Does this happen with every Evernote note? If you could answer these questions, I'll look into it.

stephen

Link to comment

UPDATE: Version 2.6 mixes a minor problem in enmd where previously paragraphs were broken into lines of a fixed length. Now, Evernote paragraphs are properly converted to MD paragraphs.

@40-02, still not certain about your bug. It might be the Russian. Could you share the Evernote note that caused the error?

stephen

Link to comment

UPDATE: Version 2.6 mixes a minor problem in enmd where previously paragraphs were broken into lines of a fixed length. Now, Evernote paragraphs are properly converted to MD paragraphs.

@40-02, still not certain about your bug. It might be the Russian. Could you share the Evernote note that caused the error?

stephen

 

Stephen, sorry for the late answer,

 

I've found that wikify created html files in root folder of my mac:

-.png

 

And that it didn't create anything in folder ~/Library/Application Support/Workflow Data/com.hackademic.wikify/

Link to comment

I've tried again with the latest version of workflow - and result is the same. 

 

What I did:

 

1. I copied the text from this google docs. 

2. I pasted it into new note on evernote

3. I typed "enmd" in alfred

4. I've tried to open the folder: "~/Library/Application Support/Workflow Data/com.hackademic.wikify/" - and there is no such folder. 

 

this is debug information:

Starting debug for 'Wikify'

[ERROR: alfred.workflow.action.script] Code 1: en2md.scpt: execution error: Traceback (most recent call last):
  File "/Users/uvaroff/Documents/Dropbox/alfred_settings_june/Alfred.alfredpreferences/workflows/user.workflow.B41135A6-FB94-4472-ABE6-D43893656DBF/dependencies/html2text.py", line 915, in <module>
    main()
  File "/Users/uvaroff/Documents/Dropbox/alfred_settings_june/Alfred.alfredpreferences/workflows/user.workflow.B41135A6-FB94-4472-ABE6-D43893656DBF/dependencies/html2text.py", line 883, in main
    data = open(file_, 'rb').read()
IOError: [Errno 2] No such file or directory: '/Users/uvaroff/Library/Caches/com.runningwithcrayons.Alfred-2/Workflow Data/com.hackademic.wikify/auction for test.html' (1)
Link to comment

Ok. This is super weird. As you can see, it is creating the HTML files. And the titles of these files are the full file paths. So, instead of creating that file name at that file path, it is creating a file with the file path as the name. I honestly have no idea why.

Shawn, do you happen to have any advice here. I'm stumped for the time being.

Link to comment

Alright. There is something funky with the Applescript code en2md.scpt. I honestly don't know what it is. But, I rewrote that function as a Python script and updated to version 3.0, now live on Packal. Please update and try enmd again with the debugger on. Let me know if this works for you.

Link to comment

Let me know if this works for you.

 

It doesn't

Starting debug for 'Wikify'

[ERROR: alfred.workflow.action.script] Code 1: 13:15:57 workflow.py:1012 ERROR    'ascii' codec can't encode characters in position 19-26: ordinal not in range(128)
Traceback (most recent call last):
  File "/Users/uvaroff/Documents/Dropbox/alfred_settings_june/Alfred.alfredpreferences/workflows/user.workflow.9872B451-5452-4CCB-8B8D-7BA77ED1D516/workflow/workflow.py", line 1010, in run
    func(self)
  File "en2md.py", line 96, in main
    file_obj.write(en_md)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 19-26: ordinal not in range(128)
Link to comment

It doesn't

Starting debug for 'Wikify'

[ERROR: alfred.workflow.action.script] Code 1: 13:15:57 workflow.py:1012 ERROR    'ascii' codec can't encode characters in position 19-26: ordinal not in range(128)
Traceback (most recent call last):
  File "/Users/uvaroff/Documents/Dropbox/alfred_settings_june/Alfred.alfredpreferences/workflows/user.workflow.9872B451-5452-4CCB-8B8D-7BA77ED1D516/workflow/workflow.py", line 1010, in run
    func(self)
  File "en2md.py", line 96, in main
    file_obj.write(en_md)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 19-26: ordinal not in range(128)

Damn. I'll fix it tomorrow and post an update.

Link to comment

Shawn, do you happen to have any advice here. I'm stumped for the time being.

 

I just saw this and was poking around the code for a bit. Running the script by itself seems to make an untitled md note just fine, but I couldn't find the HTML file (didn't look too hard).

 

One potential problem for your paths comes from needing to anticipate spaces in all the paths.

 

For instance, in pkg_installer.scpt, the installation fails if there are spaces:

This does not allow spaces in the file path
---
do shell script "open " & satimage_pkg & " -a Installer"

This allows spaces in the file path
---
do shell script "open '" & satimage_pkg & "' -a Installer"

This allows spaces in the file path
---
set satimage_pkg to quoted form of satimage_pkg
do shell script "open " & satimage_pkg & " -a Installer"

There might be some other problems linked to this. Are problems still popping up (that aren't in Python code)?

Link to comment
  • 1 month later...

I was also getting the error:

 

UnicodeEncodeError: 'ascii' codec can't encode character u'\xa0' in position 42: ordinal not in range(128)

 

I made the following change to en2md.py on line 89 and it seems to have fixed the issue for me.

 


#Convert list to full text    
en_md = '\n'.join(en_meta).encode('utf-8') #Added encode here
Link to comment

I was also getting the error:

 

I made the following change to en2md.py on line 89 and it seems to have fixed the issue for me.

 

#Convert list to full text    
en_md = '\n'.join(en_meta).encode('utf-8') #Added encode here

That's wonderful. Thank you. I'm sorry that I failed to update in a timely fashion. For everyone else, I have just pushed Version 3.1 to Packal. Please update. It fixes the Unicode bug. You can now have Unicode for both enmd and mden commands. Also, I have added the ability for Wikify to automatically select all and copy your text when you run the mden command.

Link to comment
  • 1 month later...

Thanks for these workflows!

 

Once I get a note out of EN with "enmd" and am editing it inside of Byword I would like to send my edits and changes back into the same note. Currently, making the edits then using the "mden" function from Byword creates a whole new note inside of EN. Now I have the original note and newly edited note, when I'd just like to have the original note updated with changes.

 

I hope I explained myself well enough. I have no idea whether this is possible. It would essentially be using a text editor as a MD editor for EN.

 

— C

Link to comment

Is it possible? Yes, basically. Evernote cares nothing about note titles. You could have every single one of your notes have the same title, and Evernote wouldn't bat an eye. It assigns unique note-ids to every note for uniqueness, so titles aren't important. This is why the script creates a new note, because the fact that it has the same title is of no importance (you could also change the title in the editing). My basic idea was to make the script as lightweight as possible (thus as bug-free as possible), so that users could use it however they deemed best. To get the functionality you want, you would need to tweak the AppleScript to check for a note in the specified notebook with the specified title, delete it, then create the new note.

Not overly complicated. You could use the Evernote AppleScript examples to guide you: https://dev.evernote.com/doc/articles/applescript.php

Right now, I'm swamped with school and other big projects, so I can't do it anytime soon. If you want the functionality tho, you could def add it yourself. Otherwise, you could remind me again and hopefully I'll be free then :)

stephen

Link to comment
  • 2 weeks later...

Thanks so much. This is the best thing ever.

 

I have everything working except wfy. wfy:install didn't work, so I went into the package and opened the file like you previously said to do for someone who had the same issue. 

 

All of the commands are working except wfy. Any idea how I might fix this? Thanks!

 

 

Link to comment

Thanks so much. This is the best thing ever.

 

I have everything working except wfy. wfy:install didn't work, so I went into the package and opened the file like you previously said to do for someone who had the same issue. 

 

All of the commands are working except wfy. Any idea how I might fix this? Thanks!

 

About this, 

 

I am not sure if this would work, but I went into the workflow and tried to run the script for wfy. It gives me an Apple Script error: "Evernote got an error: Can’t get notebook "!nbox"."

 

Inbox is the name of my default notebook, the one in which the note I was selecting is. 

 

Hope it helps. 

Edited by b_d_m_p
Link to comment
  • 3 months later...

I am trying to get this to work on Yosemite.

 

I am getting stuck on the wfy:install step, with the following error:

[ERROR: alfred.workflow.action.script] Code 1: pkg_installer.scpt: execution error: The files /Users/Brandon/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.8CE5BF0A-F2CA-4F0B-80D7-CBF87F519606/Support/Alfred and /Users/Brandon/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.8CE5BF0A-F2CA-4F0B-80D7-CBF87F519606/2/Alfred.alfredpreferences/workflows/user.workflow.8CE5BF0A-F2CA-4F0B-80D7-CBF87F519606/Satimage392.pkg do not exist. (1)

Ideas?

 

Thanks in advance!

 

Brandon

Link to comment

I am trying to get this to work on Yosemite.

 

I am getting stuck on the wfy:install step, with the following error:

[ERROR: alfred.workflow.action.script] Code 1: pkg_installer.scpt: execution error: The files /Users/Brandon/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.8CE5BF0A-F2CA-4F0B-80D7-CBF87F519606/Support/Alfred and /Users/Brandon/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.8CE5BF0A-F2CA-4F0B-80D7-CBF87F519606/2/Alfred.alfredpreferences/workflows/user.workflow.8CE5BF0A-F2CA-4F0B-80D7-CBF87F519606/Satimage392.pkg do not exist. (1)
Ideas?

 

Thanks in advance!

 

Brandon

Can you try opening and running the pkg_installer.scpt within the workflow directory in Script Editor itself? What line does it highlight with the error?

Link to comment

Can you try opening and running the pkg_installer.scpt within the workflow directory in Script Editor itself? What line does it highlight with the error?

 

Smarg19,

 

When I run the script in ScriptEditor, I get the following error:

 

error "The files /Support/Alfred and /2/Alfred.alfredpreferences/workflows/user.workflow.8CE5BF0A-F2CA-4F0B-80D7-CBF87F519606/Satimage392.pkg do not exist." number 1

 

When I run wfy install in Alfred I get this this debug error:

 

[ERROR: alfred.workflow.action.script] pkg_installer.scpt: execution error: The files /Users/Brandon/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.8CE5BF0A-F2CA-4F0B-80D7-CBF87F519606/Support/Alfred and /Users/Brandon/Library/Application Support/Alfred 2/Alfred.alfredpreferences/workflows/user.workflow.8CE5BF0A-F2CA-4F0B-80D7-CBF87F519606/2/Alfred.alfredpreferences/workflows/user.workflow.8CE5BF0A-F2CA-4F0B-80D7-CBF87F519606/Satimage392.pkg do not exist. (1)

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