Jump to content
Developer Wiki and Function Reference Links ×

$INCLUDE suffix and syntax


michaelk

Recommended Posts

I don't think I've ever been clear on this:

 

I'm often writing scripts in BBEdit and using $INCLUDE and the path name more or less successfully.

 

Tonight it's less successful. 

 

Does it matter what the suffix on the file name is?  Is it different if the script is for a tool or if it's for a freestanding vectorscript?

 

For tools I've been using .vs and it worked until tonight.  A previously working tool won't run using $include, but when I copy and paste the exact same script into the script editor it works.

 

For freestanding vectorscripts $include works until it doesn't.  

 

All of which leads me to believe there's something I'm not understanding.

Link to comment

The suffix does not matter — it just needs to match the file on disk, keeping in mind that .px is necessary if you want to encrypt scripts with includes. 
 

You may be experiencing an issue with the path. Paths are relative to where the script executes, so, for example, if included in a PIO, it’s relative to the PIO on disk. The path also accepts ../ to go up a directory. The same is going to be true of including a file from another include. 
 

Alternatively, you can specify an absolute path by starting with the hard drive, or on the Mac /Users, ~/, etc. If you’re just trying to consistently point to the right file, that’s usually the easiest method. 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...