If you do:
set someRealFile /Library/Tcl/Tclapplescript/pkgIndex.tcl
tk_getSaveFile -initialfile $someRealFile
the dialog converts the / to -. The workaround is to separate file and dir segments for -initialdir and -initialfile, but that is not the way Tk docs it, so it really is a Tk/Aqua bug.
Logged In: YES
user_id=90580
Originator: NO
the reason for this is that NavServices does not expect the -initialfile param to be a path but a filename in the -initialdir, and hence it munges any chars in the -initialfile that are illegal for filenames.
What behaviour did you expect to see in this case exactly? the docs are not clear what to do with a path for -initialfile IMO, indeed getOpenFile.n says -initialfile is a "filename" (and that -initialfile is not implemented on the Mac, along with other obsolete Mac info; doc bug).
We could extract any initial path component from the -initialfile param and handle it as if -initialdir had also been given, but what to do when both -initialdir and -initialfile with a path are present?
Logged In: YES
user_id=79902
Originator: NO
If both are present, [file join] them and then [file split] them to get the real directory to start in and the real "initally selected filename".