OpenInMarked.applescript's handling of the ":" character in nvALT document name

Lambert Fong's Avatar

Lambert Fong

07 Apr, 2013 08:44 PM

Brett,

I have just purchased the Marked app. I have also downloaded the Marked Bonus Pack. One of the items in the Marked Bonus Pack is an AppleScript (OpenInMarked.applescript) which allows the user to open a nvALT document in Marked.

I believed I have discovered an issue with the script:

The ":" character is illegal for file and folder names in Mac OS. However, it is possible to create nvALT document with ":" in the document name (i.e. document title). To follow the Mac file naming rule, nvALT changes all occurances of the ":" character in the file name to the "-" character.

OpenInMarked.applescript, however, does not perform this character substitution. Therefore, if I try to open a nvALT document named, for example, "ABC: 123" in Marked using the script, the script will fail with an error message stating that "ABC: 123" cannot be opened."

I have modified OpenInMarked.applescript as follows:

Current Code:

-- Grab the text in the search field, hopefully this will be the filename set p to value of text field 1 of group 1 of tool bar 1 of window 1

New Code:

-- Grab the text in the search field, hopefully this will be the filename set p_original to value of text field 1 of group 1 of tool bar 1 of window 1
set p to do shell script "echo " & p_original & " | tr : -"

The modification works for me and I am now able to open any nvALT document with ":" in its title.

As I have mentioned, I have just started with Marked and the bonus pack. The issue I described here may or may not be valid and the modification I proposed may or may not be optimal. So please take a look and let me know what you think.

Regards,

Lambert Fong

  1. Support Staff 1 Posted by Brett on 09 Apr, 2013 03:12 AM

    Brett's Avatar

    I'll test it out, thanks.

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