Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Script to apply a style to currently selected text

Guest
Feb 21, 2013 Feb 21, 2013

I can only find example scripts that work on complete files. What I want, is a script that works on currently selected text.

If I can create a macro that applies a specific paragraph style to all currently selected paragraphs, or a character style to currently selected text, I can put that style under a shortcut key.

That way, "emphasis" or "strong" can be put under ctrl-b, for example.

If there is another way to achieve the same (in RH 9), I would be interested to hear it as well.

Kind regards,

Erwin Timmerman

734
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 21, 2013 Feb 21, 2013

Nope.. Scripts do not have any information about opened files, let alone text selection. A macro is the only way to go.

Greet,

Willam

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Feb 25, 2013 Feb 25, 2013

In that case, how can I create a macro in RoboHelp that assigns a specific style to a shortcut key?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 25, 2013 Feb 25, 2013

I think this maybe a case for a tool like Macro Express. There is nothing in RoboHelp that can help.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Feb 25, 2013 Feb 25, 2013
LATEST

I had a quick look at Macro Express, but it seems that it only records key strokes and mouse clicks etc. This means that it only works if I have the style pod constantly open (which I do), always in the exact same position, with the same filter styles selected, and with the same CSS loaded, positioned at the same location in the scroll bar.

Am I correct in assuming this, or is there a better way to program it?

I am not sure this would be possible all the time. What's more, this script should work across multiple computers with different layouts, and with writers who don't really want to hack to get it working.

With character styles there would be the possibility to automatically switch to HTML view, cut, write <span...>, paste, write </span>, go back to design view.

But paragraph styles? That would be harder to do in HTML view, especially for multiple selected lines.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
RoboHelp Documentation
Download Adobe RoboHelp