Cannot run script after upgrading to 5.2.0

Mark Eagle's Avatar

Mark Eagle

19 Apr, 2018 05:58 PM

After installing 5.2.0 from 5.1.8 I cannot run my old JSTalk script. I know that you updated to CocoaScript but thought this should still work. Is there something I need to do to convert it? I never used CocoaScript but after Googling a bit they look about the same. The new location of the folder for scripts seems to have 'jstalkscripts' now:

/Applications/VoodooPad.app/Contents/Resources/jstalkscripts

Here is my script which opens a page with a date format I want to specify:

/*
VPLanguage = jstalk
VPScriptMenuTitle = New Page With Current Date
VPShortcutKey = j
VPShortcutMask = command control
VPEndConfig
*/

var dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"yyyy-MM-dd"];
 
var formattedDateString = [dateFormatter stringFromDate:[NSDate date]];

if (![document containsItemWithKey:formattedDateString]) {
[document createNewPageWithName:formattedDateString];
}

[document openPageWithTitle:formattedDateString];

  1. Support Staff 1 Posted by Sarah on 19 Apr, 2018 08:57 PM

    Sarah's Avatar

    Hi Mark,

    Thanks for bringing this up. Can you provide a bit more detail about the issue you are experiencing with your JSTalk script not running? (e.g. Is it not appearing in the menu? Is it appearing but not doing what it's supposed to?)

    Also, is there another script in that folder that has the same filename or that has the same VPScriptMenuTitle?

    Sarah
    Primate Labs Inc.

  2. 2 Posted by Mark Eagle on 20 Apr, 2018 01:09 PM

    Mark Eagle's Avatar

    The script does show up in the menu but it is not working as it did in 5.1.8. The date formatter in my script was structuring a date as yyyy-MM-dd. However, when I run the script now it uses a date format that is MM/dd/yyyy.

    I need to use the yyyy-MM-dd format so it matches the date format for Vooddoopad which is under Edit -> Insert -> Current Date. That format is yyyy-MM-dd. This makes my pages link up correctly between the two actions. If you can look at my script and help me make that work I would appreciate it. Please let me know if you have any further questions.

  3. Support Staff 3 Posted by Sarah on 20 Apr, 2018 09:35 PM

    Sarah's Avatar

    Hi Mark,

    Thanks for clarifying. The script seems to be working on our devices (displaying yyyy-MM-dd). Which model of Mac and MacOS version are you using?

    Sarah
    Primate Labs Inc.

  4. 4 Posted by Mark Eagle on 21 Apr, 2018 01:41 AM

    Mark Eagle's Avatar

    Hi Sarah,

    Here are my specs:

    Early 2015 Mac Pro 13" running High Sierra 10.13.3

    Thanks!

    Mark

  5. Support Staff 5 Posted by Sarah on 23 Apr, 2018 09:12 PM

    Sarah's Avatar

    Hi Mark,

    I appreciate you providing your specs. We'll look into this as soon as possible and I'll let you know if I have any updates.

    Thanks,

    Sarah
    Primate Labs Inc.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac