Okay, that is also helpful. I'll go a little deeper into explanation. A sample file path is listed below (renaming the actual folder names for proprietary purposes):
\\company.local\dfs\dept_name\gis_folder\projects\region\region-state-name-carrier\deliverables
That is the full file path that I would be working with. We name the maps identically to the "region-state-name-carrier" naming convention (e.g. "NC-IL-MYHOUSE-VZW"). The mxd is saved at this stage of the file path. Once we create a KML output from the mxd, it is saved in the deliverables stage of the file path.
I thought that since all file paths are identical with the exception of the "region\region-state-name-carrier" portion, I could just make static variables for "\\company.local\dfs\dept_name\gis_folder\projects\" and "\deliverables", and use the map name as the dynamic variable that will change from project to project. Essentially I need to take the map name and convert it to a string. I would take that string and strip out only the first two characters to uses as my "region", and then I would use the whole string as my "region-state-name-carrier" portion. I'll list the potential variables below for a better understanding.
mapname = mxd
- I haven't figured out how to do this yet. This is where I want to turn my map name into a string.
region = mapname[:2]
- I haven't figured this part out either, but through google I found that this is one way to strip parts of a string apart, I but it wasn't working when tried.
filePath1 = r"\\company.local\dfs\dept_name\gis_folder\projects\"
filePath2 = r"\deliverables"
arcpy.env.workspace = filePath1 + region + mapname + filePath2
if that doesn't work I am brainstorming and thinking this might work for the workspace:
workspace = filePath1 + region + mapname + filePath2
arcpy.env.workspace = workspace
I'm only thinking of this because the arcpy.env.workspace function might not like concatenating the multiple variables...but I really don't know :/.
Thanks for your input so far!