Author Topic: How to remove the Shortcut Keys from the document?  (Read 1281 times)

0 Members and 1 Guest are viewing this topic.

Offline SGK

  • Newbie
  • *
  • Posts: 8
  • Karma: 0
How to remove the Shortcut Keys from the document?
« on: April 12, 2010, 03:53:32 AM »
Hi everybody,

I wrote the script to find any Shortcut key used in the document. It only show the shortcut key names, but i want to remove all the shortcut keys which is used in the doccument or better it show the alert only if the document having any shortcut keys. Please help me if anybody aware of this!. I know you guys will always rocks!


My script are as below:
===================

tell application "Finder"
   choose file of type {"XPRJ"} with prompt "Choose the Quark"
   set theFiles to result
   open file theFiles
   
   tell document 1 of application "QuarkXPress"
      
      set StylehotKey1 to key modifiers of every style spec as text
      set StylehotKey2 to key character of every style spec as text
      
      set CharacterhotKey1 to key modifiers of every character spec as text
      set CharacterhotKey2 to key character of every character spec as text

      
      display dialog StylehotKey1 & " " & StylehotKey2 & " " & "in Paragraph StyleSheets & " & CharacterhotKey1 & " " & CharacterhotKey2 & " in Character StyleSheets"
   end tell
   
end tell

==================

please help me to sort of this issue as soon as possible.

SGK

Offline Jean-Marie Schwartz

  • Sr. Member
  • ****
  • Posts: 436
  • Karma: 6
  • Gender: Male
Re: How to remove the Shortcut Keys from the document?
« Reply #1 on: April 12, 2010, 04:17:36 AM »
You must know that key modifiers are returned as list of lists (if you code get key modifiers of every style spec: so {} if no modifier key is used, {control} if Control key is used and so on). So to "remove" any shortcut, you'll have to set every modifier key that is not {} to {}.
Then, key characters are returned as list of text items (if you code get key character of every style spec: so "" if no key character is used, "1" if 1 is used as key character, and so on). So to "remove" any shortcut, you'll have to set every key character that is not "" to "".

Hope this helps!
Jean-Marie Schwartz
May the Schwartz be with you :-)

= Mac Pro Quad-Core Intel 2.8 GHz 10 Go 1066 MHz DDR3 Mac OS 10.8.5 QuarkXPress 9.5.4.1 Adobe CS5 =

Offline SGK

  • Newbie
  • *
  • Posts: 8
  • Karma: 0
Re: How to remove the Shortcut Keys from the document?
« Reply #2 on: April 12, 2010, 05:43:57 AM »
Hi Jean,

Thanks for your quick reply, i am not much familiar with the script. If you give me as a code what you have explain the reply, it will more helpful to understand rather you explain the scenario. Please do me the favor.

Thanks in Advance,

SGK