Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X
Hi,
What's the proper way to use the windows system token(variable) for user id in a mapkey?
I would like to replace johndoe with windows %username% token.
I have tried $USER and $USERNAME with no success.
Could someone point me to the correct syntax for using a system variable in a mapkey?
mapkey(continued) ~ Select `file_saveas` `ph_list.Filelist` 1 `c:`;\
mapkey(continued) ~ Activate `file_saveas` `ph_list.Filelist` 1 `c:`;\
mapkey(continued) ~ Select `file_saveas` `ph_list.Filelist` 1 `Users`;\
mapkey(continued) ~ Activate `file_saveas` `ph_list.Filelist` 1 `Users`;\
mapkey(continued) ~ Select `file_saveas` `ph_list.Filelist` 1 `johndoe`;\
mapkey(continued) ~ Activate `file_saveas` `ph_list.Filelist` 1 `johndoe`;\
mapkey(continued) ~ Select `file_saveas` `ph_list.Filelist` 1 `mydocs_pb`;\
mapkey(continued) ~ Activate `file_saveas` `ph_list.Filelist` 1 `mydocs_pb`;\
Thanks for any help you can provide,
Don A
Solved! Go to Solution.
Can you try $userprofile (%userprofile%)? We use this syntax in mapkeys and settings and it works well. Here's an old example of a model tree config path.
mdl_tree_cfg_file $USERPROFILE\Creo4\configs\tree.cfg - This points to C:\Users\Username\Creo4\configs
Can you try $userprofile (%userprofile%)? We use this syntax in mapkeys and settings and it works well. Here's an old example of a model tree config path.
mdl_tree_cfg_file $USERPROFILE\Creo4\configs\tree.cfg - This points to C:\Users\Username\Creo4\configs
I was able to finally get it to work after doing the following:
Make sure not to navigate to a folder location but type in the full path to where you want to save or open something from!
You're file paths should look like the below text when viewing the mapkey in the config.pro file
mapkey(continued) ~ Input `file_saveas` `opt_EMBED_BROWSER_TB_SAB_LAYOUT` \
mapkey(continued) `C:\\Users\\$username\\Documents\\folder\\sub_folder\
mapkey(continued) ot_Delete`;\
mapkey(continued) ~ Update `file_saveas` `opt_EMBED_BROWSER_TB_SAB_LAYOUT` \
mapkey(continued) `C:\\Users\\$username\\Documents\\folder\\sub_folder\
mapkey(continued) ot_Delete`;~ Activate `file_saveas` `opt_EMBED_BROWSER_TB_SAB_LAYOUT`;\
mapkey(continued) ~ Activate `file_saveas` `OK`;~ Select `main_dlg_cur` `appl_casc`;\
My mapkeys now work 🙂
Thanks,
Don A