Jump to content

Calling text resource based on external csv


Recommended Posts

Hello All,


I found a post from Dan that got me 40-50% of the way to my goal, but I am struggling as I am a total Noob.


I am working with a project that has up to 1200 different versions/ possible pages, front and back. Each page can have up to 50 variables, all in various locations. I am trying to make this as simple as possible, and found this code from a previous post which showed promise.


data = new ExternalDataFileEx('/path/to/data.csv',',');

for (var i=1; i<=data.recordCount; i++) {

var frame = FindTextFrame(data.GetFieldValue(i, 'Frame'));

var att = ['width','height','x','y'];

for (var n in att)

if (a = data.GetFieldValue(i, att[n]))

frame[att[n]] = a;

frame.content = RawTextFromTagged(CreateResource(data.GetFieldValue(i, 'content')).content);



Catch is that I am trying to use Formatted Text Resources, to make the fonts easier to manage, in the content location. All I can think to do is create a huge amount of Switch statements that control the FTR being matched to the Version codes I have and then calling that rule in the 'frame.content' part of this code.


Sorry if I am losing anyone, this is not an easy task and has so many moving parts.

Link to comment
Share on other sites

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.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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...