Copy link to clipboard
Copied
Let's take a look at the InDesign version you are using:
~Barb
Hi honey620,
there could be an explanation for this behavior:
The story direction of the text frame is set to Right-to-Left. That would be typical for a text frame of a document with RTL text like you would need it with Hebrew or Arabic. You could tell if this is the cause if you select the frame and check the in- and out-ports of the frame:
Story direction left-to-right, the in-port is at the upper left, the out-port is at the lower-right:
Story direction right-to-left, the in-port is at t
...Copy link to clipboard
Copied
Information that would help us help you: Please tell us what operating system (exactly) you're running. Please tell us (exactly) what InDesign version you're using.
Show us what the text looked like BEFORE you "split text into two column" (turn on Hidden Characters when you make a screen shot). Exactly what command did you use to split into columns?
Copy link to clipboard
Copied
When you reply, please use the image icon to embed your images in the post, so other users don't have to download them to view them.
Copy link to clipboard
Copied
Hi @honey620:
When you split one column into two columns, the text runs down the first column, and then down the second column.
If the columns are reversed, are you using a Middle Eastern version of InDesign, or did the text come from an ME version of InDesign?
~Barb
Copy link to clipboard
Copied
I'm not sure, how do I check for that?
Copy link to clipboard
Copied
I copied the text from a Google Docs file, not another ID file.
Copy link to clipboard
Copied
I'm using a PC Windows 10, I have the most updated version of InDesign CC.
Copy link to clipboard
Copied
Hi @honey620 :
Actually, I can see that either the text is designated Middle Eastern or you have a Middle Eastern version installed by looking more closely at the screenshot that you posted of the paragraph panel. Directly under the left alignment button I see the left to right and right to left icons. Those don't normally appear in the English versions of the software.
Start by unsplitting, then change your paragraph composer from the World Ready Paragraph Composer to the Adobe Paragraph Composer. It's in the fly out menu from that same paragraph panel, top right corner. Resplit. Does that make a difference?
~Barb
Copy link to clipboard
Copied
Unfortunatly that did not work.
Copy link to clipboard
Copied
If you have currently a Middle Eastern version of InDesign ie. English يدعم العربية, you may fix the issue by simply opening "Story" panel which can be found under Window > Type and Tables > Story.
Select the text frame in question and switch story direction as shown here…
Copy link to clipboard
Copied
I was hoping you would see this! (And I had no idea those icons were in the Story panel in the ME version.)
~Barb
Copy link to clipboard
Copied
You nearly figured it out yourself up here Barb 😉
Copy link to clipboard
Copied
Nearly! 😂 But still needed you!
~Barb
Copy link to clipboard
Copied
thanks a lot!
Copy link to clipboard
Copied
Let's take a look at the InDesign version you are using:
~Barb
Copy link to clipboard
Copied
Hi honey620,
there could be an explanation for this behavior:
The story direction of the text frame is set to Right-to-Left. That would be typical for a text frame of a document with RTL text like you would need it with Hebrew or Arabic. You could tell if this is the cause if you select the frame and check the in- and out-ports of the frame:
Story direction left-to-right, the in-port is at the upper left, the out-port is at the lower-right:
Story direction right-to-left, the in-port is at the upper right, the out-port is at the lower-left:
So in effect, if you do Span Columns to All you get the following results.
With story direction left-to-right:
With story direction right-to-left:
To change the story direction of the parent story of a selected text frame to LTR, use this script code written in ExtendScript (JavaScript) :
app.selection[0].texts[0].parentStory.storyPreferences.storyDirection =
StoryDirectionOptions.LEFT_TO_RIGHT_DIRECTION;
How to save script code to a script file and to install that script file, see:
https://www.indiscripts.com/pages/help#hd0sb2
Regards,
Uwe Laubender
( ACP )
Copy link to clipboard
Copied
Hi @Laubender
When I Tried to the Opposite Side for Arabic (RTL) for all Document it doesnt execute?(no errors) did i make something wrong?
var myStories = app.activeDocument.stories.everyItem().storyPreferences.storyDirection;
myStories = StoryDirectionOptions.RIGHT_TO_LEFT_DIRECTION;
Copy link to clipboard
Copied
Hi M.Hasanain ,
just an idea because I assume you are using the MENA version of InDesign:
app.documents[0].stories.everyItem().storyPreferences.storyDirection =
StoryDirectionOptions.UNKNOWN_DIRECTION;
I hope that this will revert the story direction to the default one.
( Not tested, because I do not have the MENA version installed. )
Regards,
Uwe Laubender
( ACP )
Copy link to clipboard
Copied
Hi @Laubender
Yes Im Using MENA Version that Support Arabic and Hebrew, But Strange no Code Works at All of the Following! also No Errors!, anyway thanks a lot you give it a try.
app.documents[0].stories.everyItem().storyPreferences.storyDirection = StoryDirectionOptions.RIGHT_TO_LEFT_DIRECTION;
app.documents[0].stories.everyItem().storyPreferences.storyDirection = StoryDirectionOptions.UNKNOWN_DIRECTION;
app.activeDocument.stories.everyItem().storyPreferences.storyDirection = StoryDirectionOptions.UNKNOWN_DIRECTION;
Copy link to clipboard
Copied
Did you try by selecting a single text frame and run this code:
// Text frame selected.
app.selection[0].texts[0].parentStory.storyPreferences.storyDirection =
StoryDirectionOptions.RIGHT_TO_LEFT_DIRECTION;
Regards,
Uwe Laubender
( ACP )
Copy link to clipboard
Copied
Yes , Thats Works!, Thanks , also i tried the following and it works!
var myNewDoc = app.documents.add();
var myTextFrame = myNewDoc.textFrames.add({
geometricBounds: myNewDoc.pages[0].bounds
});
with(myTextFrame){
//Set the bounds of the text frame.
geometricBounds = [70, 100, 300, 200];
//Fill the text frame with placeholder text in 1 column.
textFramePreferences.textColumnCount = 1;
contents = "حسانين";
parentStory.justification = Justification.RIGHT_JUSTIFIED;
paragraphs.item(0).paragraphDirection = ParagraphDirectionOptions.RIGHT_TO_LEFT_DIRECTION
//Now set the story direction left to right
parentStory.storyPreferences.storyDirection = StoryDirectionOptions.RIGHT_TO_LEFT_DIRECTION;
}
I added new document then arabic text frame and set some attributes in arabic (Right to left)
Copy link to clipboard
Copied
You Mean we Need to Make a loop to every text frame in the Document? or something else you are thinking about!
Copy link to clipboard
Copied
"You Mean we Need to Make a loop to every text frame in the Document? or something else you are thinking about!"
Hm. No.
This should work:
var storiesArray = app.documents[0].stories.everyItem().getElements();
for( var n=0; n<storiesArray.length; n++ )
{
storiesArray[n].storyPreferences.storyDirection =
StoryDirectionOptions.RIGHT_TO_LEFT_DIRECTION;
};
Regards,
Uwe Laubender
( ACP )
Copy link to clipboard
Copied
Your Genius @Laubender , Thanks a lot
Copy link to clipboard
Copied
Hi @Laubender
in this example i want to target only all Tables (to changes their stories direction) in the Document, so it done with the nested loops like that (script is working):
//Change Only Tables Direction Story in All DOC to RTL
var myDoc = app.documents[0];
app.doScript(ChangeTablesStoryDirectionRTL, ScriptLanguage.JAVASCRIPT, undefined, UndoModes.ENTIRE_SCRIPT, "Change Tables Story Direction");
function ChangeTablesStoryDirectionRTL(){
for ( s = myDoc.stories.length-1; s >= 0; s-- ){
for ( t = myDoc.stories[s].tables.length-1; t >= 0; t-- ){
myTable = myDoc.stories[s].tables[t];
myDoc.stories[s].storyPreferences.storyDirection = StoryDirectionOptions.RIGHT_TO_LEFT_DIRECTION;
}
}
}
but now i need to make the opposite (to exclude tables and keep only TextFrames to change stories) but i failed to reverse the operation!, i stuck!