AnsweredAssumed Answered

List Anomaly

Question asked by jkappa on Jul 15, 2013
Latest reply on Jul 15, 2013 by jkappa
So I'm trying to export a subset of a DDP setup. Print statements are just for debugging purposes:
If I do this, it works out fine:
import arcpy mxd = arcpy.mapping.MapDocument("CURRENT") pageNameList = ["DSA107", "DSA108"] #arcpy.GetParameter(0) outputFolder = arcpy.GetParameterAsText(1) for pageName in pageNameList:       pageID = mxd.dataDrivenPages.getPageIDFromName(pageName)     mxd.dataDrivenPages.currentPageID = pageID     print outputFolder + '\\' + str(pageName) + '.jpg'     #arcpy.mapping.ExportToJPEG(mxd, outputFolder + "\\" + str(pageName) + ".jpg", resolution=200)  #Ouptut: C:\Users\jkappa\Desktop\DSA107.jpg C:\Users\jkappa\Desktop\DSA108.jpg 


But if I do this, which is what I really want to do so the user can input through the interface of a script tool, it does this:
import arcpy mxd = arcpy.mapping.MapDocument("CURRENT") pageNameList = arcpy.GetParameter(0)  #["DSA107", "DSA108"] outputFolder = arcpy.GetParameterAsText(1) for pageName in pageNameList:       pageID = mxd.dataDrivenPages.getPageIDFromName(pageName)     mxd.dataDrivenPages.currentPageID = pageID     print outputFolder + '\\' + str(pageName) + '.jpg'     #arcpy.mapping.ExportToJPEG(mxd, outputFolder + "\\" + str(pageName) + ".jpg", resolution=200)  #Ouptut: C:\Users\jkappa\Desktop\D.jpg C:\Users\jkappa\Desktop\S.jpg C:\Users\jkappa\Desktop\A.jpg C:\Users\jkappa\Desktop\1.jpg C:\Users\jkappa\Desktop\0.jpg C:\Users\jkappa\Desktop\7.jpg C:\Users\jkappa\Desktop\;.jpg C:\Users\jkappa\Desktop\D.jpg C:\Users\jkappa\Desktop\S.jpg C:\Users\jkappa\Desktop\A.jpg C:\Users\jkappa\Desktop\1.jpg C:\Users\jkappa\Desktop\0.jpg C:\Users\jkappa\Desktop\8.jpg


I've been stuck for a while now.
Can somebody clue me in, please?

Outcomes