View Single Post
  #1  
Old December 4th, 2018, 05:34 AM
Josh Josh is offline
Forum n00b
 
Join Date: Oct 2016
Posts: 7
Default Calling text resource based on external csv

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.GetFieldValu e(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.
Reply With Quote