Shipping scripts Import/Export Directory Trees and Global Search

25 views
Skip to first unread message

Larry bw

unread,
Feb 9, 2019, 8:02:11 AM2/9/19
to Notecase Pro
Hi,

I'm a new user so I have a few questions that I couldn't find the solutions for.  Sorry if some of these have already been discussed.   

I can't get some of the Shipping Scripts to work correctly that I'd like to use.  I'm new to NCP so I'm sure it's something I'm doing wrong but have tried a few different things and now I'm at a loss.   I'm not familiar with programming but have started looking into learning Lua just for NCP as it seems like you'd be able to do pretty much anything you need with it. 

I'm running Windows 10, updated with the current (2/9/2019) newest builds so I'm guessing it's with the changes in the way Windows does things since the scripts were made.
I'm also just executing the scripts from the "Script Manager" and have tried them with Shortcut keys assigned.

These are the scripts I've tried.


22_ImportTextFileTree

It does create a new blank document.

Then a message pops up that says "Ok" but nothing in document.  

I've even tried creating a directory that it looked  like this script may pull it from (c:\temp\test) and putting the text tree in there but that didn't work.


42_ImportRtfFileFolder

It asks me to choose the directory. 

It does create a new blank document.

Error message that pops up with #42-

..Files\NoteCasePro\app\scripts\42_ImportRtfFileFolder.lua:35: bad argument #1 to 'dir' (string expected, got nil)



47_ExportRtfFileFolder

Error message that pops up with #47-

.Files\NoteCasePro\app\scripts\47_ExportRtfFileFolder.lua:31: attempt to concatenate a nil value (local 'strCurrentDir')



59_GlobalSearch

This one works great for finding the text and popping up a list of matches, but when I click on one of the list items and then "Ok" (or double click) it doesn't go to that note.  The list just dissappears and I'm still at where I was before the search.


Any help would be appreciated. 

Thanks,
Larry

Miroslav Rajcic

unread,
Feb 9, 2019, 3:26:33 PM2/9/19
to Larry bw, noteca...@googlegroups.com
Hi Larry,

thanks for the report, I will check the scripts in the morning and will post my results here.

Regards,
  Miro


From: noteca...@googlegroups.com <noteca...@googlegroups.com> on behalf of Larry bw <wester...@gmail.com>
Sent: Saturday, February 9, 2019 2:02 PM
To: Notecase Pro
Subject: Shipping scripts Import/Export Directory Trees and Global Search
 
--
You received this message because you are subscribed to the Google Groups "Notecase Pro" group.
To unsubscribe from this group and stop receiving emails from it, send an email to notecase-pro...@googlegroups.com.
To post to this group, send email to noteca...@googlegroups.com.
Visit this group at https://groups.google.com/group/notecase-pro.
For more options, visit https://groups.google.com/d/optout.

Larry bw

unread,
Feb 9, 2019, 3:35:57 PM2/9/19
to Notecase Pro
Thanks Miro,  I don't know if it's anything wrong with the scripts or just me not knowing what I'm doing yet.  I'm betting on the later.

Larry

Miroslav Rajcic

unread,
Feb 10, 2019, 2:38:41 AM2/10/19
to Larry bw, noteca...@googlegroups.com
Hi Larry,

I've tested, the 1st two issues are due to a bug in LuaFileSystem library. I've reverted to an older version and both scripts work fine now.
I've created a Windows 32-bit build fixing the issues here:
It only ships changed files, not a full installation, so keep your existing install and just overwrite your .exe (and .pdb) file with the one from the archive linked above.

GlobalSearch script had a bug, it's been fixed here:

The final script you reported "47_ExportRtfFileFolder" works OK here, could be due to downgrading LuaFileSystem library.

Can you please test if the scripts work OK with a new build?

Regards,
   Miro


Sent: Saturday, February 9, 2019 9:35 PM
To: Notecase Pro
Subject: Re: Shipping scripts Import/Export Directory Trees and Global Search
 
--

Larry bw

unread,
Feb 10, 2019, 4:18:40 AM2/10/19
to Notecase Pro
Hi Miro,

  Again, thanks for all the trouble.  
Here's the results so far.

 22_ImportTextFileTree works perfectly now.

59_GlobalSearch works perfectly now.

42_ImportRtfFileFolder still getting the same error message as before.  I even tried copying the rtf tree to the c:\temp\test directory to try there since it's not nestled into so many directories where it originally is but that didn't work either.

Thanks again,
Larry

Paul Merrell

unread,
Feb 10, 2019, 4:29:02 AM2/10/19
to Notecase Pro
Hi, Miro,

Am I doing something wrong or do we have a problem with Nc_GUI_FileDlg()?

Sample:

-- gets directory path to process recursively
strTopLevel = Nc_GUI_FileDlg(0, "", "Select Directory to Process", "", 1)

I *think* I've configured the method to select a directory, but when I
select a directory and hit Open, it opens the subdirectory instead.
And it's showing non-directory files.

On Linux Mint 18.1 64-bit.

Best regards,

Paul

Larry bw

unread,
Feb 10, 2019, 5:15:18 AM2/10/19
to Notecase Pro
I'm trying to become familiar with the Lua scripting so jumped into the script file 42_ImportRtfFileFolder and noticed it had a commented selection for the directory (c:\temp\rtf) above the "Choose Directory" call.  I commented the "Choose Directory" and uncommented the static c:\temp\rtf and tried copying my Rtf tree there.

I ran the script and from what I can see worked great.  I like having a directory to export/import all that data between programs anyway so this works even easier for me.

I'm going to try that with the 47 export script too, put in the static directory instead of choosing one.

Thanks for everything.  I'm having a good time starting to learn all this stuff.

Have a good one,
Larry

Paul Merrell

unread,
Feb 10, 2019, 5:20:21 AM2/10/19
to Notecase Pro
Larry, if you're importing lots of notes, you might want to also check
out script 60. See Help file > User Interface > Shipping Scripts >
60_Auto-IconListedNotes.lua

NC Pro doesn't yet automatically assign icons to imported notes.
Script 60 can make short work of that task.

Best regards,

Paul

Larry bw

unread,
Feb 10, 2019, 5:33:35 AM2/10/19
to Notecase Pro
Thanks Paul, that script would be very useful, but the scripts I have only go up to #59. I searched the "Get Scripts" page but didn't see that one anywhere.  How would I go about finding that?

Larry

Larry bw

unread,
Feb 10, 2019, 5:36:46 AM2/10/19
to Notecase Pro
I tried #47 and set a static directory instead of choosing one and it worked fine.  This will actually save a little trouble of having to choose one.

Thanks Miro and Paul for the help, it's really appreciated.

Peace out.
Larry

Paul Merrell

unread,
Feb 10, 2019, 5:44:42 AM2/10/19
to Notecase Pro
On Sun, Feb 10, 2019 at 2:33 AM Larry bw <wester...@gmail.com> wrote:
>
> Thanks Paul, that script would be very useful, but the scripts I have only go up to #59. I searched the "Get Scripts" page but didn't see that one anywhere. How would I go about finding that?

Odd. We've got it in the Help file but apparently it hasn't shipped
yet. It's attached.

Paul
60_Auto-IconListedNotes.lua

Miroslav Rajcic

unread,
Feb 10, 2019, 8:11:26 AM2/10/19
to Larry bw, noteca...@googlegroups.com
I'd like to reproduce your results if possible.
Can you archive minimal tree that triggers such issue and attach it with the customized script itself (so I can see what folder did you hard-code).

Regards,
  Miro


Sent: Sunday, February 10, 2019 10:18 AM

To: Notecase Pro
Subject: Re: Shipping scripts Import/Export Directory Trees and Global Search

Miroslav Rajcic

unread,
Feb 10, 2019, 10:27:03 AM2/10/19
to Paul Merrell, noteca...@googlegroups.com
Hi Paul,

API definition:
string Nc_GUI_FileDlg(boolean bSave [, string strInitialDir, string strTitle, string strFileName, boolean bMultiSelect, boolean bSelectFolder, int
 nDefaultFilter, string strFilter1Title, string strFilter1Mask, string strFilter2Title, string strFilter2Mask, ...])

Last parameter (having value 1) in your call actually enabled multi-select, but not "select folder" mode.
Correct call would be:
strTopLevel = Nc_GUI_FileDlg(0, "", "Select Directory to Process", "",  0, 1)

just as it is already used in script "42_ImportRtfFileFolder.lua"

Regards,
  Miro


From: noteca...@googlegroups.com <noteca...@googlegroups.com> on behalf of Paul Merrell <mar...@gmail.com>
Sent: Sunday, February 10, 2019 10:28 AM

To: Notecase Pro
Subject: Re: Shipping scripts Import/Export Directory Trees and Global Search

Paul Merrell

unread,
Feb 10, 2019, 4:51:56 PM2/10/19
to Miroslav Rajcic, noteca...@googlegroups.com
Thanks, Miro,

I was hoping it was my mistake. I got my wish.

The revised shipping script is attached.

Best regards,

Paul
22_ImportTextFileTree.lua

Miroslav Rajcic

unread,
Feb 11, 2019, 12:17:39 AM2/11/19
to Paul Merrell, noteca...@googlegroups.com
Thanks Paul,
will include new version to be released in the next cycle.

Regards,
  Miro


From: Paul Merrell <mar...@gmail.com>
Sent: Sunday, February 10, 2019 10:51 PM
To: Miroslav Rajcic
Cc: noteca...@googlegroups.com

Subject: Re: Shipping scripts Import/Export Directory Trees and Global Search
Reply all
Reply to author
Forward
0 new messages