How to programatically emulate bookmark selection? I have created a button within the "fileselect" panel when selected goes off and allows the user to select a file in the "cloud" via another application. When the user selects the file in the cloud it is copy to their local system in a predefined location and the file's path is returned to Blender.

What I would like to do is now update the panel file path and name to point to the drive, path and file similar to what happens when a user selects a bookmark. Here is my code so far:

class SchedulePLM(bpy.types.Operator):
bl_idname = "object.schedule_plm"
bl_label = "PLM..."

def invoke(self, context, event):
    # create path to app location
    ypsApp = gtlngstring.GetLanguageDir() + "ypsApp.exe"
    # build the args
    args = [ypsApp,"-f"]
    imagefile = subprocess.check_output(args)
    # print("imagefile: ", imagefile)
    if len(imagefile) != 0:
        dirname = os.path.dirname(imagefile)
        basename = os.path.basename(imagefile)
        # print("dir: ", dirname)
        # print("file: ", basename)
# update file path and file name in panel
    return {'RUNNING_MODAL'}

bpy.utils.register_class(SchedulePLM)
I did not see the "answer my own question" so here it goes. I found the following to work.

bpy.ops.file.select_bookmark(dir=dirname.decode())


This gets me to the folder where the file was saved. I would like to update the file name also but for now this works for me.