Quantcast
Channel: Adobe Community : All Content - FrameMaker Scripting
Viewing all articles
Browse latest Browse all 888

Change a command’s position on a menu?

$
0
0

Hi Everyone

 

I wrote a little Script to let FrameMaker 10 user save Version 8 fm-Files.

The Script works good so far, but the Command is not placed a the position in the Menu where I like to have it (after the Save in the File Menu). Do I do something wrong with the PrevMenuItemInMenu?: 



var fileMenu = app.GetNamedMenu("FileMenu")
var saveAsCmd = app.GetNamedCommand("Save");
var newCmd=DefineCommand(1,"Save As fm 8.0" ,"Save As fm 8.0","")
fileMenu.AddCommandToMenu(newCmd)
newCmd.PrevMenuItemInMenu = saveAsCmd; 
UpdateMenus(); 
function Command(cmd){    switch(cmd) {        case 1:            var file;            file  = app.ActiveBook;            if (!file.ObjectValid()) {                file = app.ActiveDoc;                if (!file.ObjectValid()) {                    Alert("No active document or book found", Constants.FF_ALERT_CONTINUE_NOTE);                }              }            var params = GetSaveDefaultParams();            var returnParamsp =new PropVals();            var i = GetPropIndex(params, Constants.FS_FileType);            params[i].propVal.ival =Constants.FV_SaveFmtBinary80;            file.Save(file.Name, params, returnParamsp);            break;        }}

 

Thanks!


Viewing all articles
Browse latest Browse all 888


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>