🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: adobe.photoshop.scripting
10 messages
10 total messages Started by stan_alachniewicz Thu, 19 Mar 2009 20:48
Problem with include
#211
Author: stan_alachniewicz
Date: Thu, 19 Mar 2009 20:48
12 lines
876 bytes
Hi,

I'm trying to use includes for the first time and I have

#include "writeHTML.js"

where 'writeHTML.js' is in the same directory as the script calling it.

I've tried setting includepath to "./" or "/" or leaving it out altogether, but no luck... what am I doing wrong? I really don't want to use an absolute path...

Thanks,
Stan
Re: Problem with include
#212
Author: Paul_R
Date: Thu, 19 Mar 2009 21:45
17 lines
870 bytes
if using cs3 or higher put this line above the #include
#includepath $.fileName.parent

or CS2
#includepath WhoAmI().parent
#include "writeHTML.js"

function WhoAmI() {
	var where;
	try {
		var FORCEERROR = FORCERRROR;
	}
	catch( err ) {
		where = File(err.fileName);
	}
	return where;
}
Re: Problem with include
#218
Author: stan_alachniewicz
Date: Fri, 20 Mar 2009 16:15
5 lines
735 bytes
thanks, I tried adding that, but I still get the error

Error 48: File or folder does not exist

-> #include "writeHTML.js"
Re: Problem with include
#220
Author: stan_alachniewicz
Date: Fri, 20 Mar 2009 16:28
7 lines
738 bytes
ok this is odd (and kinda lame)

If I add the line

includepath

with nothing behind it, the damn thing works. unbelievable.
Re: Problem with include
#221
Author: xbytor
Date: Fri, 20 Mar 2009 16:49
14 lines
1074 bytes
stan_alachniewicz@adobeforums.com wrote:
> ok this is odd (and kinda lame)
> 
> If I add the line
> 
> includepath
> 
> with nothing behind it, the damn thing works. unbelievable.

Nearly all of my scripts have an includepath specified, whether it's used or 
not. It appears that you have to have at least one for '.' to be implicitly part 
of the include path. Odd indeed.

-X
Re: Problem with include
#222
Author: stan_alachniewicz
Date: Fri, 20 Mar 2009 18:03
1 lines
782 bytes
Hi X, haven't seen you in a while. haven't scripted in a bit, and now I'm working on what else, my web gallery script...
Re: Problem with include
#232
Author: stan_alachniewicz
Date: Mon, 23 Mar 2009 20:07
1 lines
762 bytes
ok, now I'm really irritated... so the script dialog opens, but it's not finding a function within the included .js file. what is going on?
Re: Problem with include
#234
Author: Paul_R
Date: Mon, 23 Mar 2009 20:17
7 lines
824 bytes
It would depend on where the include is and what format the function is declared.
functionName = function(){
}
would need to be inserted before calling.
function functionName(){
}
This should work anywhere.
Re: Problem with include
#236
Author: stan_alachniewicz
Date: Mon, 23 Mar 2009 20:53
1 lines
601 bytes
nevermind
Re: Problem with include
#248
Author: stan_alachniewicz
Date: Tue, 24 Mar 2009 17:26
1 lines
729 bytes
ok this is @#$@#$ing ridiculous. Now it's not working again. I have changed NOTHING and it just decides not to work. great product Adobe.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads