[ID CC-CC2021] Заменить местами с помощью GREP

sft

Участник
Топикстартер
Сообщения
12
Реакции
0
Доброе время суток
У меня возникла такая проблема. Редактор просить поменять местами точку и верхний индекс.
например:
^56. на .^56
Можете подсказать как с помощью GPEP поменять их местами?

Заранее Спасибо!
 

_MBK_

Пикирующий бомбардировщик
15 лет на форуме
Сообщения
33 138
Реакции
10 835

Bebs

15 лет на форуме
Сообщения
461
Реакции
223
Сами мы не местные. Я отшень плёхо гаварить па руски. У меня возникать такой проблем-мромблем. Редактора просить поменять местами точку и верхнюю индексу. ;)
"^56. на .^56" — это надо полагать маркер сноски. Воспользуйтесь скриптом.
 

Bebs

15 лет на форуме
Сообщения
461
Реакции
223
Кстати скрипт не помог решить проблему.
Код:
/
***********************************************************************/
/*                                                                     */
/*   MigrationAppels :: Deplace les appels de note AVANT les signes    */
/*                      de ponctuation fermants (espaces incluses)     */
/*                                                                     */
/*   [Ver: 1.2]   [Author: Marc Autret]          [Modif: 08/04/12]     */
/*   [Lang: FR]   [Req: InDesign CS4/CS5+/CS6]   [Creat: 09/11/09]     */
/*                                                                     */
/*   NB. - Nom original du script: "PonctNote" (2009) concu sur une    */
/*         idee de Laurent Tournier -- cf. www.indigrep.com            */
/*                                                                     */
/*   Installation:                                                     */
/*                                                                     */
/*   1) Place the current file into Scripts/Scripts Panel/             */
/*                                                                     */
/*   2) Run InDesign, open the document you want to cleanup            */
/*                                                                     */
/*   3) Exec the script from your scripts panel:                       */
/*        Window > Automation > Scripts   [CS3/CS4]                    */
/*        Window > Utilities > Scripts    [CS5/CS6]                    */
/*      + double-click on the script file name                         */
/*                                                                     */
/*   Bugs & Feedback : marc{at}indiscripts{dot}com                     */
/*                     www.indiscripts.com                             */
/*                                                                     */
/***********************************************************************/

function main()
{
    var PATTERN = "[,;.?!~e\s]+~F",
        LO_BEFORE = LocationOptions.BEFORE,
        a, i, n, t;
    
    with( app )
        {
        findGrepPreferences = null;
        changeGrepPreferences = null;
        findChangeGrepOptions.includeFootnotes = false;
        findGrepPreferences.findWhat = PATTERN;
        scriptPreferences.enableRedraw = false;
        }
    
    a = (t=app.properties.activeDocument) && t.findGrep();
    i = n = a && a.length;
    
    while( i-- )
        {
        t = a[i].texts[0].characters;
        t[-1].move(LO_BEFORE, t[0]);
        }
    
    with( app )
        {
        findGrepPreferences = null;
        changeGrepPreferences = null;
        scriptPreferences.enableRedraw = true;
        }

    alert( n ?
        (n + " appels de note vont \xEAtre d\xE9plac\xE9s.") :
        "Aucun d\xE9placement d'appel de note."
        );
}

app.doScript(
    main,
    ScriptLanguage.JAVASCRIPT,
    undefined,
    UndoModes.fastEntireScript,
    "MigrationAppels"
    );
Это странно. А эти цифры точно маркеры сносок?
Если да, можете сделать серию замен:
Снимок экрана 2020-06-27 в 14.24.48.pngСнимок экрана 2020-06-27 в 14.27.07.pngСнимок экрана 2020-06-27 в 14.29.22.png
 

sft

Участник
Топикстартер
Сообщения
12
Реакции
0
Код:
/
***********************************************************************/
/*                                                                     */
/*   MigrationAppels :: Deplace les appels de note AVANT les signes    */
/*                      de ponctuation fermants (espaces incluses)     */
/*                                                                     */
/*   [Ver: 1.2]   [Author: Marc Autret]          [Modif: 08/04/12]     */
/*   [Lang: FR]   [Req: InDesign CS4/CS5+/CS6]   [Creat: 09/11/09]     */
/*                                                                     */
/*   NB. - Nom original du script: "PonctNote" (2009) concu sur une    */
/*         idee de Laurent Tournier -- cf. www.indigrep.com            */
/*                                                                     */
/*   Installation:                                                     */
/*                                                                     */
/*   1) Place the current file into Scripts/Scripts Panel/             */
/*                                                                     */
/*   2) Run InDesign, open the document you want to cleanup            */
/*                                                                     */
/*   3) Exec the script from your scripts panel:                       */
/*        Window > Automation > Scripts   [CS3/CS4]                    */
/*        Window > Utilities > Scripts    [CS5/CS6]                    */
/*      + double-click on the script file name                         */
/*                                                                     */
/*   Bugs & Feedback : marc{at}indiscripts{dot}com                     */
/*                     www.indiscripts.com                             */
/*                                                                     */
/***********************************************************************/

function main()
{
    var PATTERN = "[,;.?!~e\s]+~F",
        LO_BEFORE = LocationOptions.BEFORE,
        a, i, n, t;
   
    with( app )
        {
        findGrepPreferences = null;
        changeGrepPreferences = null;
        findChangeGrepOptions.includeFootnotes = false;
        findGrepPreferences.findWhat = PATTERN;
        scriptPreferences.enableRedraw = false;
        }
   
    a = (t=app.properties.activeDocument) && t.findGrep();
    i = n = a && a.length;
   
    while( i-- )
        {
        t = a[i].texts[0].characters;
        t[-1].move(LO_BEFORE, t[0]);
        }
   
    with( app )
        {
        findGrepPreferences = null;
        changeGrepPreferences = null;
        scriptPreferences.enableRedraw = true;
        }

    alert( n ?
        (n + " appels de note vont \xEAtre d\xE9plac\xE9s.") :
        "Aucun d\xE9placement d'appel de note."
        );
}

app.doScript(
    main,
    ScriptLanguage.JAVASCRIPT,
    undefined,
    UndoModes.fastEntireScript,
    "MigrationAppels"
    );
Это странно. А эти цифры точно маркеры сносок?
Если да, можете сделать серию замен:
Посмотреть вложение 133133Посмотреть вложение 133134Посмотреть вложение 133135
Спасибо. Помог второй способ с помощью ГРЕБ 'thank'
 

iv-mi

15 лет на форуме
Сообщения
563
Реакции
375
В 2010 году этот вопрос обсуждался на adobeindesign.ru
там тоже используется скрипт Аутрета, но другой.
Посмотрите, может пригодится в другой раз.
 
  • Спасибо
Реакции: sft