🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.indesign.sdk
Article #159

Passing values to Javascripts/ write to text file

#159
From: 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...
Technical Details
Message-ID: <59b86438.-1@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshub.sdsu.edu!webcrossing

Show Full Headers
Complete Article Headers
X-Google-Thread: f63e9,a5b1779b3707cbf9,start
X-Google-Attributes: gidf63e9,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: subhaoviya@adobeforums.com
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshub.sdsu.edu!webcrossing
Newsgroups: adobe.indesign.sdk
Subject: Passing values to Javascripts/ write to text file
Message-ID: <59b86438.-1@webcrossing.la2eafNXanI>
Date: Tue, 24 Mar 2009 03:17:34 -0700
Lines: 19
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Original-Lines: 23