Monday, December 18, 2017

#26 2017-06-02 05:09:14 am

Nigel Garvey
Moderator
From:: Warwickshire, England
Registered: 2002-11-20
Posts: 4458

Re: Export selected notes from Notes.app w/ attachments, import to EN

Hi Alcedo.

Yes. I'm pretty sure the error's happening in the lines I pinpointed last night. But it doesn't necessarily mean your database file's empty, only that the regex couldn't be matched in the "text" from it. (The error code 9.22337203685478E+18 is such a large number that you have to subtract it from a pretty large amount before the truncated form of the result is anything other than -9.22337e+18.)

So, either:
Your database is empty, or
It doesn't contain any note CIDs, or
The CIDs are in a different format from those used in El Capitan and Sierra ("<xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx@home>" or "<xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx>" — where each "x" is a hexadecimal digit character), or
You have more than one database file in ~/Library/Containers/com.apple.Notes/Data/Library/Notes whose name ends with "-wal" and the script's reading the wrong one, or
ISOLatin1StringEncoding isn't the best interpretation to impose when reading the file, or
Something else I haven't thought of.

The search regexes could be made tighter by changing every instance of "[[:alnum:]]" in them to "[[:xdigit:]]", but otherwise any fix would depend on what's causing the CIDs not to be identified.


NG

Offline

 

#27 2017-10-07 03:41:52 pm

JMichaelTX
Member
From:: Houston, TX (The Woodlands)
Registered: 2014-07-12
Posts: 139

Re: Export selected notes from Notes.app w/ attachments, import to EN

Nigel Garvey wrote:

This version populates the attachment file list with aliases to where Notes keeps the attachments. It works for me, BUT it carries an enormous health warning.



@Nigel, sorry, but I'm not following the meaning of "BUT it carries an enormous health warning.".
Could you please explain?

Looks like a great script, and shows a lot of innovation.  I  haven't had a chance to test it yet in my system (macOS 10.11.6), but I  hope  to soon.

Thanks for sharing.


iMac-27 Late 2015 Retina 5K Screen (& others)
macOS 10.11.6 (El Capitan)

Offline

 

#28 2017-10-08 03:09:13 am

Nigel Garvey
Moderator
From:: Warwickshire, England
Registered: 2002-11-20
Posts: 4458

Re: Export selected notes from Notes.app w/ attachments, import to EN

JMichaelTX wrote:
Nigel Garvey wrote:

This version populates the attachment file list with aliases to where Notes keeps the attachments. It works for me, BUT it carries an enormous health warning.



@Nigel, sorry, but I'm not following the meaning of "BUT it carries an enormous health warning.".
Could you please explain?


Hi JMichaelTX.

Pretty much what it says in the rest of that paragraph and in the caveats in the script comments. The script uses regex to parse a database file, which isn't the most foolproof idea in the world, and was written by someone who doesn't use Notes and doesn't have Evernote or an iCloud account. The Notes side of it worked in 10.11.6 on my machine with the on-board notes I created to research the problem, but otherwise I was hoping that someone with more knowledge of database and/or Evernote scripting would be able to expand my groundwork into something more solid.

Since the post before yours, MacScripter's site software's been updated and some characters in the posts above are now appearing as gibberish strings through being interpreted with different encodings from the ones under which they were posted. The '|⌘|' label I use as a shortcut for 'current application' looks like '|⌘|' (although this doesn't actually sabotage the script) and there are various other things throughout the thread such as '—Â' for '—' and the misrendering of the diacriticals in Yvan's results.


NG

Offline

 

#29 2017-10-09 03:31:46 am

Nigel Garvey
Moderator
From:: Warwickshire, England
Registered: 2002-11-20
Posts: 4458

Re: Export selected notes from Notes.app w/ attachments, import to EN

I wrote:

… and was written by someone who doesn't use Notes and doesn't have Evernote or an iCloud account.


By which I mean my contribution, of course. I didn't mean to imply any disregard for the original code by either d.b.walker or JMichaelTX.


NG

Offline

 

#30 2017-12-01 09:04:42 pm

tornado
Member
Registered: 2017-12-02
Posts: 1

Re: Export selected notes from Notes.app w/ attachments, import to EN

Just checking to see if there's been any activity forward on this. The two scripts do not seem to work with High Sierra. The first one produces the 0 byte file and the second failed with

error "Can’t make missing value into type alias." number -1700 from missing value to alias

on the

set end of attachmentFiles to (attachmentLookup's valueForKey:(thisCID)) as alias

line.

Thanks!

Last edited by tornado (2017-12-01 09:05:12 pm)


Filed under: notes, Evernote Export

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)