I am tryting to create thumbnails of all the mxd's in a directory but no mater how high I set the value of the "While" loop it gives me an "Index out of range" error...
Also can I get it to look at subdirectories as well?
best,
#Make thumbnails from all mxd's in current directory
import arcpy, glob, os, sys
from arcpy import env
from arcpy import mapping
env.overwriteOutput = True
#path = sys.argv[1] # for using in toolset, use directory parameter
path = os.getcwd() # Script in same directory as files being processed
mxdList = glob.glob(path + "\*.mxd")
env.workspace = path
x=0
print 'Reading mxd files from ' + path
mxd_List = glob.glob('*.mxd')
count_Mapdocs = len(mxd_List)
print mxd_List,count_Mapdocs
while x < 50:
mapDocs=mxd_List[x]
mapDoc=arcpy.mapping.MapDocument(mapDocs)
framesList=arcpy.mapping.ListDataFrames(mapDoc)
mapDoc.activeView=framesList[x]
mapDoc.makeThumbnail()
mapDoc.save()
print "Created thumbnail for " + mxd_List[x]
print "x= "+ str(x)
x=x+1
print "x updated =" + str(x)