Applescript - trying to horizontally align all the text in a text frame
I've tried the following snippet along with several others:
tell application "Adobe InDesign CS5.5"
tell the active document
set Text_Frame to the text frame "PH"
tell Text_Frame
set theLines to every line
if (theTextPos = "B") then
tell theLines to set justification to left align
else
tell theLines to set justification to center align
end if
end tell
end tell
end tell
Throws errors about setting classes.
ie
error "Can’t set «class paln» of {\"MISSOULA COMMUNITY PHYSICIANS
\", \"CENTER NO. 2
\", \"CONDOMINIUM ASSOCIATION
\", \"2827 FORT MISSOULA ROAD
\", \"MISSOULA, MT 59804
\"} to «constant mAOHcent»." number -10006 from «class paln» of {"MISSOULA COMMUNITY PHYSICIANS
", "CENTER NO. 2
", "CONDOMINIUM ASSOCIATION
", "2827 FORT MISSOULA ROAD
", "MISSOULA, MT 59804
All I'm trying to do is center the text in a text frame if a condition is met, else left align it if another condition is met.
Any suggestions woudl be appreciated.
Don't get the lines first:
if (theTextPos = "B") then
set justification of every line to left align
else
set justification of every line to center align
end if
Similar Messages
-
Hi my Mac keeps highlighting different action boxes (on its own) all the time a strange text box has appeared on the screen that informs you if you press a key or click on a item. if the sound is turned up you are informed when a item is highlighted or a you click on a item HELP!
Hi Thanks for your help fixed the problem
Kind Regards
Nannedee -
How do I stop all the browser/HTML/menu text from appearing as numbered squares?
A couple weeks ago ALL text in my firefox browser started appearing as numbered squares. It's all HTML on the page, javascript popups, text fields, menus... everything. This did not happen after I did an update or anthing, it just happened partway through the day when I opened the browser window. I tried doing an update when I was prompted, which didn't help, and I tried completely uninstalling and reinstalling the latest version.
Try to toggle some Boolean gfx.font_rendering prefs on the about:config page to disable some features.<br />
Filter: gfx
Some to try:
* set gfx.direct2d.disabled to true to disable Direct2D
* set gfx.font_rendering.directwrite.use_gdi_table_loading to false
To open the <i>about:config</i> page, type <b>about:config</b> in the location (address) bar and press the "<i>Enter</i>" key, just like you type the url of a website to open a website.<br />
If you see a warning then you can confirm that you want to access that page.<br />
*Use the Filter bar at to top of the about:config page to locate a preference more easily.
*Preferences that have been modified show as bold (user set).
*Preferences can be reset to the default via the right-click context menu if they are user set
*Preferences can be changed via the right-click context menu: Modify (String or Integer) or Toggle (Boolean)
Try to disable hardware acceleration.
*Tools > Options > Advanced > General > Browsing: "Use hardware acceleration when available" -
How can i read all the lines from a text file in specific places and use the data ?
string[] lines = File.ReadAllLines(@"c:\wmiclasses\wmiclasses1.txt");
for (int i = 0; i < lines.Length; i++)
if (lines[i].StartsWith("ComboBox"))
And this is how the text file content look like:
ComboBox Name cmbxOption
Classes Win32_1394Controller
Classes Win32_1394ControllerDevice
ComboBox Name cmbxStorage
Classes Win32_LogicalFileSecuritySetting
Classes Win32_TapeDrive
What i need to do is some things:
1. Each time the line start with ComboBox then to get only the ComboBox name from the line for example cmbxOption.
Since i have already this ComboBoxes in my form1 designer i need to identify where the cmbxOption start and end and when the next ComboBox start cmbxStorage.
2. To get all the lines of the current ComboBox for example this lines belong to cmbxOption:
Classes Win32_1394Controller
Classes Win32_1394ControllerDevice
3. To create from each line a Key and Value for example from the line:
Classes Win32_1394Controller
Then the key will be Win32_1394Controller and the value will be only 1394Controller
Then the second line key Win32_1394ControllerDevice and value only 1394ControllerDevice
4. To add to the correct belonging ComboBox only the value 1394Controller.
5. To make that when i select in the ComboBox for example in cmbxOption the item 1394Controller it will act like i selected Win32_1394Controller.
For example in this event:
private void cmbxOption_SelectedIndexChanged(object sender, EventArgs e)
InsertInfo(cmbxOption.SelectedItem.ToString(), ref lstDisplayHardware, chkHardware.Checked);
In need that the SelectedItem will be Win32_1394Controller but the user will see in the cmbxOption only 1394Controller without the Win32_
This is the start of the method InsertInfo
private void InsertInfo(string Key, ref ListView lst, bool DontInsertNull)
That's why i need that the Key will be Win32_1394Controller but i want that the user will see in the ComboBox only 1394Controller without the Win32_Hello,
Here is a running start on getting specific lines in the case lines starting with ComboBox. I took your data and placed it into a text file named TextFile1.txt in the bin\debug folder. Code below was done in
a console app.
using System;
using System.IO;
using System.Linq;
namespace ConsoleApplication1
internal class Program
private static void Main(string[] args)
var result =
from T in File.ReadAllLines(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "TextFile1.txt"))
.Select((line, index) => new { Line = line, Index = index })
.Where((s) => s.Line.StartsWith("ComboBox"))
select T
).ToList();
if (result.Count > 0)
foreach (var item in result)
Console.WriteLine("Line: {0} Data: {1}", item.Index, item.Line);
Console.ReadLine();
Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my webpage under my profile but do not reply to forum questions. -
All the implications of placing text from another file
Hi all,
I have a large document with masters that I use for my proposals. I created all the masters I need in this file, then when I get a request for proposal, I just copy out the masters I need for that particular one (depending on the products requested).
The original file is getting pretty big (175 MB), and I'm looking for ways to make it smaller, as it's starting to drag. I was thinking of cutting all text out of it, creating Word docs, then placing the text back in, but I had some questions.
1. Will this really shrink the file size that much?
2. How will the Word document be affected if I change text within InDesign? Do changes in InDesign change the original document?
3. Will all of my character styles stay (such as highlighting the area where I need to fill in the customer's name)?
If anyone could point me to a good reference on placing text or help me with some guidance I would much appreciate it. This is a big project and I want to start it correctly.
Thanks!Before you do anything try file>save as and save the file that way.
Bob -
I recently loaded Lion on both my laptop and desktop. On the laptop only, iTunes is now trying to load automatically literallly all the time! What can I do to stop the madness???
The only way to reinstall Safari on a Mac running v10.7 Lion is to restore OS X using OS X Recovery
Instead of restoring OS X in order to reinstall Safari, try troubleshooting extensions.
From the Safari menu bar click Safari > Preferences then select the Extensions tab. Turn that OFF, quit and relaunch Safari to test.
If that helped, turn one extension on then quit and relaunch Safari to test until you find the incompatible extension then click uninstall.
If it's not an extensions issue, try troubleshooting third party plug-ins.
Back to Safari > Preferences. This time select the Security tab. Deselect: Allow plug-ins. Quit and relaunch Safari to test.
If that made a difference, instructions for troubleshooting plugins here.
If it's not an extension or plug-in issue, delete the cache.
Open a Finder window. From the Finder menu bar click Go > Go to Folder
Type or copy paste the following
~/Library/Caches/com.apple.Safari/Cache.db
Click Go then move the Cache.db file to the Trash.
Quit and relaunch Safari to test. -
Reader 11 wil not install. Goes all the way through the process and fails sending an error message indicating need to contact the vendor.
Try using the offline installer from http://get.adobe.com/reader/enterprise/
-
How to get all the objects in a stack frame
Hi, what I'm trying to do is get all the objects on the top of the stack and time stamp them.
What I have is this:
static void mearthScanStack(jvmtiEnv *env, jmethodID method, jthread thread){
jobject obj;
int i;
jlong tag;
jvmtiError err;
jvmtiLocalVariableEntry *localVarTable;
jint entryCount;
err = (*env)->GetLocalVariableTable(env, method, &entryCount, &localVarTable);
if(err == JVMTI_ERROR_ABSENT_INFORMATION || err == JVMTI_ERROR_NATIVE_METHOD){
return;
check_jvmti_error(gdata->jvmti, err, "mearthScanStack: Could not get local variable table");
for(i = 0; i < entryCount; i++){
if( (localVarTable.signature)[0] == 'L'){
err = (*env)->GetLocalObject(env, thread, 0, localVarTable[i].slot, &obj);
check_jvmti_error(gdata->jvmti, err, "mearthScanStack: Could not get local object");
err = (*env)->GetTag(env, obj, &tag);
check_jvmti_error(gdata->jvmti, err, "mearthScanStack: Could not get tag for local object");
timeStampObject(env, obj);
(*env)->Deallocate(env, localVarTable);
}To walk through, first I get the local object variable table, then I loop through each entry in the table. I check each entries signature to see if it is an object (starts with "L"), and if it is, I try get its tag, and time stamp it.
This doesn't seem to work, however, because I get JVMTI_ERROR_INVALID_SLOT errors on the call to GetLocalObject. How can it be an invalid slot if I am getting the slot out of the local variable table? Am I going about this the right way
Additionally, when I get the the table, I'm ignoring the JVMTI_ERROR_ABSENT_INFORMATION error. I'm not exactly sure under what circustances this information is absent. Is there a way I could scan the stack frame even if it is not available (just probe through the slots maybe?)
Any help is greatly appreciated.I would think if you intanciate the XMLReference and use IIDXMLElement GetChildCount / GetNthChild would do what you are looking for.
Ian -
I have tried everything to get text to "wrap completely around" other text, images, shapes. Mac Pages - tried Word Processing and tried Page Layout. Inspector, wrap, Floating and Object causes wrap. The text will ONLY wrap at the TOP and BOTTOM of the object, etc. No matter which choice I make in Object causes wrapping. It just doesn't work. I have worked for hours on this - I can't find a solution. HELP!
What version of Pages?
I suspect you are using Pages 5 in OSX 10.9 not OSX 10.8.4.
Peter -
HT203261 I use emojis all the time when I text my girlfriend who owns a Droid 3.
Whenever I send a longer text with an emoji, the text message completely changes to something I sent in the past, thus confusing her. Does anybody else have this problem?
If you have a fairly new Mac...
You are still under warranty. Call Apple Care. Make sure you get a case number as all repairs have an additional 90 days of warranty.
#1 - You have 14 days from the date of purchase to return your computer with no questions asked.
#2 - You have 90 days of FREE phone tech support.
#3 - You have the standard one year Apple warranty.
#4 - If you've purchased an AppleCare Protection Plan, your warranty last for 3 years. You can obtain AppleCare anytime up to the first year of the purchase of your computer.
Take FULL advantage of your warranty. Posting on a message board should be done as a last resort and if you are out of warranty or Apple Care has expired. -
It really wasn't that much liquid but now I'm freaking out. I've always used clorox wipes and this has never happened to me. I'm going to leave it for a few days to dry just so I don't mess it up anymore. I'm debating putting it in rice. I just can't believe that small amount of liquid could ruin my macbook
I just can't believe that small amount of liquid could ruin my macbook
The traces (copper connections) on the logic boards are pretty close together. It wouldn't take much to short two critical points out.
I hope putting it away for a few days (maybe in the warm sun) works for you. Because that is all I would have suggested. -
I need in more lines of the Index some words in Bold text and some others in Kursiv text. How can i get it? It seems to me that either I can edit a Style only in Bold Text or in Kursiv Text
I make you an example to clear what I really need:
Index
Introduction
I. Leonardo's Monnalisa
II. Leonardo's Battaglia
Bibliography
Please HELP HELP HELPWhat version of Pages are you referring to?
Basically if you are talking about the Table of Contents in Pages and want to have different character styles within paragraphs in the T.O.C. you will have to export the T.O.C. and bring it back in as text and change that.
Peter -
Trying to make Photos all the same size, not working out...
I'm hoping someone can make sense of this for me. I can't figure it out. I'm not savvy when it comes to DPI and Pixels.
While using PSE7 I make a new project.
I go to file and blank and make my new project 8 inches by 10 inches and 1200 resolution.
I then use file and open up some photos, one at a time, they are on the board on the bottom of my screen. I now have 3 of them.
I click each photo individual and bring it up on the editing board (not sure of the terminology). I click on image and resize and keep constraints. I make the photo 4" high by what ever width it makes it. I also make it 1200 resolution.
I drag each photo on the 8" X 10" and they are all not the same height, shouldn't they be the same next to each other, they are all 4" high, I checked. There is a just a little difference, but for the project I'm working on, I want them exactly 4" high.
any ideas??
Thanks.Resolution of 1200 px/in is excessive. For printing, resolution 240-300px/in is adequate, and for web posting 72 will do nicely.
Suggest that you embrace the following work flow:
Go to File>New>blank file, enter width & height, resolution, Color mode:RGB, Backgrond:white
It is desirable that the individual pictures have the same, or at least close, resolution as the file created in step #1.
Open picture #1. Access the crop tool, and on the options bar of the tool you can enter width & height in inches, and the resolution, then size the picture with precision by cropping.
Either copy/paste, or drag, the picture to the blank file from step #1. Use the move tool to position the picture
Repeat for pictures 2&3.
It is helpful to have the rulers displayed , and the grid facilitates orientation (View>check rulers>grid)
Another approach in PEv.8, is to go to the Create tab, and go down to Photo Collage. You will find a layout for 3 pictures, and nice themes. -
Please help me retrieve my data i lost. i tried to restore the settings again but it didnt work.
Please tell up in more detail what you did?
If yu go to iTunes>Prefernces>Devices does the date/time of the iPod backup corespnd to when yur started the backup or before?
Didyou backup via USB or to iCloud? -
UDF to get all the numbers in a text
Hi Experts,
Is there a way to get the numbers in a string?
Example.
ABCdef1234
ZYX567
I only need 1234 and 567.
Please advise.Hi,
Please try this modified code taken from the Sun Developer Network. This code uses regex:
UDF Type:
ContextType
imports:
java.util.regex; (if you are using PI 7.1 you must remove the semicolon)
arguments:
input1
Here's the code (courtesy of Sun Developer Network):
Pattern p = Pattern.compile("[a-zA-Z]");
Matcher m = p.matcher(input1[0]);
StringBuffer sb = new StringBuffer();
boolean output = m.find();
while(output) {
m.appendReplacement(sb, "");
output = m.find();
m.appendTail(sb);
result.addValue(input1[1]);
Hope this helps,
Edited by: Mark Dihiansan on Mar 15, 2010 7:59 AM
Maybe you are looking for
-
How to rpad spaces for the below code
begin dbms_output.put_line(rpad(null,10,' ') ||'b'); end; The output is not appending spaces. I have a requirement to append spaces between columns. Some times the column will be empty. In that case the space is not getting appended.Please let me kno
-
How is the command for closing a JFrame window. Not hiding but really closing, and but not closing the whole application. Mark.
-
IPhoto library sudden problems with gray thumbs/pictures
Very suddenly, the pictures in the iPhoto library started behaving oddly. They would show up normally until the slider was moved to larger and then become gray. Double-clicking would not open them, either in edit or in another image program. After re
-
Why has the Adobe Paper extension for PS CC disappeared from the Extension menu?
-
When to call to close account when contract ends
My contract is up on October 15 i want to close my account when contract ends since my account manager no longer wants to use the account any longer. so i wanted to know when do i exactly call Verizon to cancel before the date or the same day ? an