Include Path ??

Discussion of the xtools Toolkit

Moderators:xbytor, DavideBarranca, Paul MR

Post Reply
Jaco
Include Path ??

Post by Jaco » Tue Sep 23, 2008 6:57 pm

Hi guys.

Thanks for this great site. It has helped me so much. The X-Tools just Rocks and has made my work easy. By day I am a Oracle developer and over weekends I do my passion. http://blog.jdphotography.co.za

I am the owner of Furi books here in South Africa. We make coffee table books for photographers.

I have now developed a script that will check the book layout and cut it up into the pages we need.

I have one problem and I know I will find it if I look hard for it.
The //@include path of the xlib libraries does not seem to work the same in CS2 and CS3. Is these a simple way to make it work in both versions ?

Thanks for the help all

xbytor

Include Path ??

Post by xbytor » Tue Sep 23, 2008 10:42 pm

Code: Select allI have one problem and I know I will find it if I look hard for it.
The //@include path of the xlib libraries does not seem to work the same in CS2 and CS3. Is these a simple way to make it work in both versions ?

I have the same code with //@includes working in CS,CS2,CS3 and CS4 identically. There may be something in your directory structure that is not what it should be.

Can you get me more information?

-X

Jaco

Include Path ??

Post by Jaco » Tue Sep 23, 2008 11:03 pm

I have copied the xlib folder under my script folder so the structure is like this

c:\Furi Page Checker\xlib


On CS3 if I take out the //@includepath "/c/Furi Page Checker" it still works
but on CS2 if fails


//@includepath "/c/Furi Page Checker"
//@include "xlib/LogWindow.js"
//@include "xlib/PSConstants.js"
//@include "xlib/stdlib.js"


I get this error

folder "xlib/LogWindow.js" does not exists


But now I get something funny. I just removed the path include and the script is still working 100%. Why would it at first not work in CS2 ?

xbytor

Include Path ??

Post by xbytor » Tue Sep 23, 2008 11:10 pm

If you don't have an include path, it will use the folder of the script as the include path. If your script is in "/c/Furi Page Checker" all is well.

It may also check Presets/Scripts as an implicit part of the includepath.

You are safest by always having an include path. I have two folders in mine: one for XP and one for OS X. The installation script actually modifies the include paths in the xtools/xapps scripts so that they point to your local installation directory.

-X

Jaco

Include Path ??

Post by Jaco » Tue Sep 23, 2008 11:22 pm

I developed the script on a CS3 PC at work after I installed the X-Tools and all worked fine. Then I came home and tried to run the script on my CS2 with out installing the X-tools but I did have the xlib folder like stated above. It did not want to work. So I installed the X-Tools to see it it would solve the problem. Still it did not work so I included the include path. That fixed the problem. I restarted PS not sure if that fixed it as it will now run with out the include path

I want to give this script to other photographers to check their layouts before they send them to us as it takes up a lot of our time to check it, so I will not know where they install them and it may be on Mac. Sorry I am new to PS scripting, ask me a Oracle question

How will I make sure the include path is set dynamically ?

Thanks

xbytor

Include Path ??

Post by xbytor » Tue Sep 23, 2008 11:31 pm

This is the default includepath.

Code: Select all//@includepath "/c/Program Files/Adobe/xtools;/Developer/xtools"


The first path is the default installation of xtools on XP. The second is the default installation path on OS X. As long as they install xtools in the default place, you can use the includepath from above in your script and it will find the xlib files whether you're on XP or OS X.


The other, better solution is to use the FlattenJS script from xtools. It will take a script with //@includes and generate a single flattened file with everything in it. That flattened file is what you provide for other people to use.

-X

Jaco

Include Path ??

Post by Jaco » Thu Sep 25, 2008 6:46 am

Thanks X. That sorted the problem. Thanks for the great site and all the help.

kpt

Include Path ??

Post by kpt » Tue Oct 14, 2008 7:11 am

I've had problems with some friend's CS2-installations where an include like
Code: Select all//@include "lib.jsx"

didn't work, although the file "lib.jsx" was in the same directory as the script who referenced it.

The error message was "File does not exist" and then a reference to the line
Code: Select all//@include "lib.jsx"

Kabe

Include Path ??

Post by Kabe » Mon Nov 17, 2008 1:03 pm

I've the same issue here and made an observation that might help to sort this out. The Include file is in the same place as the main file. Windows XP, CS2.

Now....
...if I open the script with "Browse...." from Photoshop, it works just fine.
...if I drop the *.jsx on the Photoshop icon, then the script doesn't find it's includes!

Hope it helps

Kabe

Post Reply