import os, threading def OpenLink ([SubtypeCD], [Name] ): if [SubtypeCD] == 'Recorded' and [Name] is not None: parsedName = [Name].partition('-') folderPrefix = parsedName[0].zfill(4) fileSuffix = parsedName[2].zfill(4) extension = '.TIF' fileName = folderPrefix + fileSuffix + extension loc = r"\\base\path" image = os.path.join(loc, folderPrefix, fileName) threading.Thread(target=os.startfile, args=(image,)).start() elif [SubtypeCD] == 'Unrecorded' and [Name] is not None: parsedName =[Name].split('-') folderOne = parsedName[0] + '_Survey' folderTwo = [Name] fileName = [Name] + '0001.tif' loc = r"\\other\base\path' image = os.path.join(loc, folderOne, folderTwo, fileName) threading.Thread(target=os.startfile, args=(image,)).start() else: pass return
Solved! Go to Solution.