Forum Replies Created
-
AuthorPosts
-
Michel Allio for FRIdNGE
ParticipantIf you want help, give real samples!
(^/)
April 13, 2017 at 3:37 pm in reply to: Script to apply paragraph style to text found in table cell #93701Michel Allio for FRIdNGE
Participantfunction checkWhichTable()
{
if (app.selection.length != 1) return null;
var currentTable = app.selection[0];
if (currentTable.hasOwnProperty(“baseline”)) currentTable = app.selection[0].parent;
while (currentTable instanceof Cell || currentTable instanceof Row || currentTable instanceof Column) currentTable = currentTable.parent;
if (!(currentTable instanceof Table)) return null;
return currentTable;
}app.doScript(checkUserSelection, ScriptLanguage.JAVASCRIPT, undefined, UndoModes.ENTIRE_SCRIPT, “Process Table”);
function checkUserSelection ()
{
var a_table = checkWhichTable();
if (a_table == null) {
if (confirm(“No table selected. Do you want to process *all* tables?”) == false)
return;
allTables = app.activeDocument.stories.everyItem().tables.everyItem().getElements();
for (var a = 0; a < allTables.length; a++) processTable (allTables[a]);
} else processTable (a_table);
}function processTable(myTable)
{
myTable.rows.everyItem().height = “36pt”;
myTable.cells.everyItem().autoGrow = true;
var myCells = myTable.cells.everyItem().getElements(),
C = myCells.length,
myTextInCell = [“Activity”, “Possible Answers”],
myRegEx = new RegExp(“b(” + myTextInCell.join(“|”) + “)b”);
for ( var c = 0; c < C; c++) if (myCells[c].texts[0].contents.match(myRegEx)) myCells[c].texts[0].paragraphs[0].appliedParagraphStyle = “table H2”;
}//__(^/)
April 13, 2017 at 1:18 am in reply to: Edit script to convert certain paragraph-style to sidenotes. #93687Michel Allio for FRIdNGE
Participant…
(^/)
Michel Allio for FRIdNGE
ParticipantAha! Never too late! =D
(^/)
Michel Allio for FRIdNGE
ParticipantMichel Allio for FRIdNGE
ParticipantJohanna, it’s a script I’ve written for clients who have this kind of layouts
(^/)
Michel Allio for FRIdNGE
Participant… If I can help, I’m French! So I can read your text!! ;-)
(^/)
Michel Allio for FRIdNGE
Participant…
(^/)
March 24, 2017 at 2:26 pm in reply to: Cross Referencing: Is it possible to change the reference to be lowercase? #93117Michel Allio for FRIdNGE
ParticipantDo the opposite! You can capitalize something in lowercase using a grep style!
(^/)
Michel Allio for FRIdNGE
ParticipantReally basically here, 2 Grep styles:
.+(?=\|)
\|\K.+
(^/)
Michel Allio for FRIdNGE
ParticipantI’m back from my very long holidays! =D
Place the cursor in text and play:
app.selection[0].contents = $.getenv(‘USER’);
(^/)
Michel Allio for FRIdNGE
Participant“… Actually on vacancy! Please, let me a message after the bip! …”
Bip!
(^/) ;-)
Michel Allio for FRIdNGE
ParticipantDon’t say: “it doesn’t work!” but “I don’t know what to do with this code!” =D
[It works fine for me!]
(^/)
PS: in my video, I could have included variables (so simple!) in the slug created by the script in all chosen folder docs but I’m really too lazy for that … and don’t want to loose time for free today! ;-)
Michel Allio for FRIdNGE
ParticipantYou’ll need Javascript! :-)
(^/)
March 18, 2017 at 9:13 am in reply to: shifting footnote's separator line to right or left, how? #92929Michel Allio for FRIdNGE
ParticipantHi,
Show a screenshot!
(^/)
-
AuthorPosts
