3

How do I incorporate jsLint into BBEdit?

  • Environment:
    • OSX Mountain Lion
    • BBEdit 10.1.2 (3152)

I installed Node.js (0.8.14) and ran

sudo npm install -g jslint

I am able to run jslint from the command line by running

jslint [filepath/]filename

I found a tutorial that seems to explain how to connect jsLint to BBEdit; however, I have never written an AppleScript and have no idea where to start.

Any guidance would be much appreciated.


UPDATE

I loaded the AppleScript from the tutorial into the AppleScript Editor Application and ran it.

I'm now getting the following error message:

Can’t get paragraphs 3 thru -1 of "Can’t make POSIX path of missing value into type Unicode text.".

losthorse
  • 1,450
  • 13
  • 31

1 Answers1

1

I found the problem. I am using the BBEdit FTP browser and working directly off the server. This was causing problems with the file path that the AppleScript was relying on.

A short-term solution is to work on the file locally and then upload it when complete.

The better solution would be to mount the server as a drive. This would provide the most functionality with the greatest ease of use.

losthorse
  • 1,450
  • 13
  • 31
  • I have started using the second 'better solution' listed above. I am using OSXFUSE and SSHFS to mount my server as a drive. This lets BBEdit access the files as if they were on the local machine. I then run the JSLint AppleScript. – losthorse Nov 05 '12 at 18:48
  • 1
    It's worth noting that few scenarios would make working directly on remote files the 'best practice.' A local development environment is the common pattern except when security demands that code not move from a given machine (which, is clearly *not* the case for you, since you're using a local IDE that is scriptable) – New Alexandria Dec 24 '12 at 14:20