🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: adobe.indesign.sdk
2 messages
2 total messages Started by subhaoviya Tue, 24 Mar 2009 10:17
Passing values to Javascripts/ write to text file
#159
Author: subhaoviya
Date: Tue, 24 Mar 2009 10:17
20 lines
1395 bytes
Hi,

I m new to InDesign Programming. I m using InDesign CS3 on MAC OS...
Is it possible to pass values to a javascript through plugin code?
I have a dialog with textboxes in it, On clicking ok button a script is called which uses these text box values for processing. Is this possible or is this the only way: to write them into a text file and read the textfile in script....

Another simple doubt: writing to textfile
I get my textbox value as PMString, how to convert it to char*

PMString string = this->GetTextControlData(kBscDlgTextEditBoxWidgetID);
FILE* fh = FileUtils::OpenFile(file, "wt");
if (fh != NULL)
{
	fprintf(fh, "%s\n", string);
	fclose(fh);
}

This gives 2 warnings that this willcrash application during runtime...

Someone Pls guide me...
Re: Passing values to Javascripts/ write to text file
#163
Author: Kamrun
Date: Tue, 24 Mar 2009 14:35
12 lines
833 bytes
Are you looking for this:

in C++ :
Utils<IScriptArgs>()->Set(yourkeyStr ,yourvalueStr );

in JavaScript:
if(app.scriptArgs.isDefined(yourkeyStr)) {
     var yourvalueStr = app.scriptArgs.get(yourkeyStr)
}

HTH,
Kamran
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