cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

menu to queue print jobs, need help modifing menu link

SOLVED
Highlighted
Aquamarine

menu to queue print jobs, need help modifing menu link

Trying to add the set preference to my queue menu, but it does not seem to work. Looking for some guidance in ACL.

 

# create menu
if (!menu_exists('.Window')) {
return;
}

if ( !menu_exists( '.Queue.' ) ) {

menu_add -menu .Window "Queue";

menu_add "Queue." ""Long" cmd "set -preference petransactionoptions = \"queueID:long\""";
menu_add "Queue." ""Short" cmd "set -preference petransactionoptions = \"queueID:short\""";
menu_add "Queue." ""None" cmd "set -preference petransactionoptions = \"queue:yes\""";

}


} # _addmenu()

 

Thanks 

 

BRyon

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: menu to queue print jobs, need help modifing menu link

I'm a bit rusty myself but I think you are almost there. If it were me I'd simplify it down a little at least for initial testing to get it working? I added my version of this code at the bottom. I used the Help Center as a reference, I haven't tested this in Arbortext yet. BTW, in case you didn't know already you can use the response() command to test out if the -cmd is being called correctly. It will popup a dialog so you can see what it is about to do.

 

https://support.ptc.com/cs/help/arbortext_hc/ae61_hc/aeAcl/help9122.html

 

function addQueueMenu() {
  if ( !menu_exists( ".Queue." ) ) {

    menu_add -menu .Window "Queue";

    menu_add .Queue. "Long" -cmd {set -preference petransactionoptions = "queueID:long"};
    menu_add .Queue. "Short" -cmd {set -preference petransactionoptions = "queueID:short"};
    menu_add .Queue. "None" -cmd {set -preference petransactionoptions = "queue:yes"};

  }
}

add_hook("menuloadhook", "addQueueMenu");

View solution in original post

5 REPLIES 5

Re: menu to queue print jobs, need help modifing menu link

Hi Bryon,

 

This is actually covered in the Arbortext Help Center but long story short you need to use menuloadhook() - see here: https://support.ptc.com/cs/help/arbortext_hc/ae61_hc/aeAcl/help796.html?queryId=173b1b3f891#ATI.759

 

-Gareth

Highlighted

Re: menu to queue print jobs, need help modifing menu link

Thanks for the info Gareth, I am not an ACL kind of guy, more of a hack and slash... or copy and paste...

 

Something like this?

 

function _addmenu() {

 

if ( !menu_exists( '.Queue.' ) ) {

menu_add -menu .Window "Queue";

menu_add "Queue." ""Long" cmd "set -preference petransactionoptions = \"queueID:long\""";
menu_add "Queue." ""Short" cmd "set -preference petransactionoptions = \"queueID:short\""";
menu_add "Queue." ""None" cmd "set -preference petransactionoptions = \"queue:yes\""";

}


} # _addmenu()

 

# function: _menuloadhook()

function _menuloadhook(win,menupath) {
_addmenu();
} # _menuloadhook()

 

 

# function: _addhook()
function _addhook() {
add_hook('menuloadhook',package_name()."::_menuloadhook");
} # _addhook()

 

Thanks,

Bryon

 

Highlighted

Re: menu to queue print jobs, need help modifing menu link

I'm a bit rusty myself but I think you are almost there. If it were me I'd simplify it down a little at least for initial testing to get it working? I added my version of this code at the bottom. I used the Help Center as a reference, I haven't tested this in Arbortext yet. BTW, in case you didn't know already you can use the response() command to test out if the -cmd is being called correctly. It will popup a dialog so you can see what it is about to do.

 

https://support.ptc.com/cs/help/arbortext_hc/ae61_hc/aeAcl/help9122.html

 

function addQueueMenu() {
  if ( !menu_exists( ".Queue." ) ) {

    menu_add -menu .Window "Queue";

    menu_add .Queue. "Long" -cmd {set -preference petransactionoptions = "queueID:long"};
    menu_add .Queue. "Short" -cmd {set -preference petransactionoptions = "queueID:short"};
    menu_add .Queue. "None" -cmd {set -preference petransactionoptions = "queue:yes"};

  }
}

add_hook("menuloadhook", "addQueueMenu");

View solution in original post

Highlighted

Re: menu to queue print jobs, need help modifing menu link

Thank You Gareth, that works as expected.

 

 

Bryon

Highlighted

Re: menu to queue print jobs, need help modifing menu link

Just doing some clean up removed the  dot before Queue and added the ""

 

if ( !menu_exists( '.queue.' ) ) {

menu_add -menu .Window "Queue";

menu_add "Queue." "Long" -cmd {set -preference petransactionoptions = "queueID:long"};
menu_add "Queue." "Short" -cmd {set -preference petransactionoptions = "queueID:short"};
menu_add "Queue." "None" -cmd {set -preference petransactionoptions = "queue:yes"};

 

Thanks again Gareth

 

Bryon

Announcements