2022.2

Table Of Contents
Beatles Letitbe 1970
RollingStones Letitbleed 1969
LedZeppelin LedZeppelin3 1970
LedZeppelin LedZeppelin4 1971
RollingStones StickyFingers 1971
Thepurposeofthescript,again,istosettherecordboundarywhenEITHERtheyearORtheartist
changes.
Thescriptwouldlooklikethis:
/* Read the values of both columns we want to check */
var zeBand = boundaries.get(region.createRegion(1,1,30,1));
var zeYear = boundaries.get(region.createRegion(61,1,65,1));
/* Check that at least one of our variables holding previous values have been
initialized already, before attempting to compare the values */
if (boundaries.getVariable("lastBand")!=null) {
(zeBand[0]!=boundaries.getVariable("lastBand") || zeYear[0]!-
!=boundaries.getVariable("lastYear"))
{
boundaries.set();
}
}
boundaries.setVariable("lastBand",zeBand[0]);
boundaries.setVariable("lastYear",zeYear[0]);
ThisscriptusestheexactsamecodeasusedforCSVfiles,withtheexceptionofparametersexpected
bythecreateRegion()method.Thegetmethodadaptstothecontext(thedatasourcefile)andthere-
foreexpectsdifferentparameterstobepassedinordertoachievethesamething.Sinceatextfiledoes
notcontaincolumnnamesasaCSVdoes,theAPIexpectsthetextregionstobedefinedusingphysical
coordinates.Inthisinstance:Left,Top,Right,Bottom.
Totrythiscode,pastethedataintoatexteditorandsavethefiletoAlbums.txt.Thencreateanew
DataMapperconfigurationandloadthisTextfileasyourdatafile.IntheDataInputSettings,specifyOn
linesasthePage delimitertypewiththenumberoflinessetto1.Whenyounowsettheboundary
TriggertoOn script,thefilewillbeprocessedlineperline(triggeringtheeventoneachline).Paste
theabovecodeintheJavaScriptexpressionfieldandclicktheApplybuttontoseetheresult.
Note: ThePDFcontextalsoexpectsphysicalcoordinates,justliketheTextcontextdoes,but
sincePDFpagesdonothaveagridconceptoflinesandcolumns,theaboveparameterswould
insteadbespecifiedinmillimetersrelativetotheupperleftcornerofeachpage.Soforinstance,
Page 368