Trouble assigning TextFrame to Justification.Left

Hello,
I need some help trouble shooting a script.
I am trying to flip the justification for all of a selected set of text frames. However, while most types of flipping work properly, the following does not
if(sel[i].story.textRange.justification == Justification.RIGHT){
         sel[i].story.textRange.justification = Justification.LEFT;
I would expect the justification for items that are Justification.RIGHT to switch to Justification.LEFT, but they remain as Justification.RIGHT
It does not fail, it just does not work as expected.
What is odd is that it seems to work correctly for the three other types of justification I am flipping in the same script. See below for the full script.
Any ideas what is causing this?
try
          // Check current document for textFrames.
          if ( app.documents.length < 1 ) {
                    alert ( "open a document with text objects and select them." );
          else {
                    docRef = app.activeDocument;
                    if ( docRef.textFrames.length < 1 ) {
                              alert ( "Select some text objects." );
                    //where text fames are selected swap the jusification
                    else {
                              sel = docRef.selection;
                              var sellen = sel.length;
                              for (var i=0;i<sellen ;i++)
                                        if(sel[i].typename == "TextFrame"){
                                                  if(sel[i].story.textRange.justification == Justification.LEFT){
                                                            sel[i].story.textRange.justification = Justification.RIGHT;
                                                  else if(sel[i].story.textRange.justification == Justification.RIGHT){
                                                            sel[i].story.textRange.justification = Justification.LEFT;
                                                  else if(sel[i].story.textRange.justification == Justification.FULLJUSTIFYLASTLINELEFT){
                                                            sel[i].story.textRange.justification = Justification.FULLJUSTIFYLASTLINERIGHT;
                                                  else if(sel[i].story.textRange.justification == Justification.FULLJUSTIFYLASTLINERIGHT){
                                                            sel[i].story.textRange.justification = Justification.FULLJUSTIFYLASTLINELEFT;
catch (e){
          alert("Script Failed!\n"+e);

Give redraw a chance:
          // Check current document for textFrames.
          if ( app.documents.length < 1 ) {
                    alert ( "open a document with text objects and select them." );
          else {
                    docRef = app.activeDocument;
                    if ( docRef.textFrames.length < 1 ) {
                              alert ( "Select some text objects." );
                    //where text fames are selected swap the jusification
                    else {
                              sel = docRef.selection;
                              var sellen = sel.length;
                              for (var i=0;i<sellen ;i++)
                                        if(sel[i].typename == "TextFrame"){
                                                  if(sel[i].story.textRange.justification == Justification.LEFT){
                                                            sel[i].story.textRange.justification = Justification.RIGHT;
                                                  else if(sel[i].story.textRange.justification == Justification.RIGHT){
                                                            sel[i].story.textRange.justification = Justification.LEFT;
                                                  else if(sel[i].story.textRange.justification == Justification.FULLJUSTIFYLASTLINELEFT){
                                                            sel[i].story.textRange.justification = Justification.FULLJUSTIFYLASTLINERIGHT;
                                                  else if(sel[i].story.textRange.justification == Justification.FULLJUSTIFYLASTLINERIGHT){
                                                            sel[i].story.textRange.justification = Justification.FULLJUSTIFYLASTLINELEFT;
          redraw()

Similar Messages

  • I'm having trouble assigning keyboard to their own channels.

    I have trouble assigning keyboard to different channels.  I am using 3 keyboards.  One is an M-Audio Keyrig49 which is using on USB port.  The other two MIDI keyboards are ports A and B going through an M-Audio MIDISPORT 4x4.  The Macbook is detecting 5 MIDI channels (4 from the MIDISPORT and one from the Keyrig49), but keyboards always "learn" on channel 1.  I would like to assign each keyboard to its own channel.  Suggestions?

    Actually, you can assign each keyboard to its own group of 1-16 MIDI channels. I'm using 3 keyboards, too, and I believe you'll find it easier to do it this way. Below is a snapshot of Audio MIDI Setup. All my keyboards are connected to USB MIDI cables. USB ports work the same way. I named and color-coded all the USB MIDI cables and keyborad icons for easy ID and troubleshooting. Then when you create and assign screen controls in layout mode, it's easy to find the right keyboard(fig. 2).
    Each keyboard can transmit on any and all MIDI channels, without conflicting with another MIDI device. Hope this helps.

  • Network trouble assigning static IP, dhcpcd works but not static.

    I've tried static IP in rc.conf and assigning it manually.  When I assign it manually, and my gateway route, it shows up with static but doesn't talk on network.  Then I do a dhcpcd to the same NIC and viola, it gets assigned an IP on subnet I was specifying manually, only now it's talking once dhcpcd has been run.  However, it still doesn't see  (cannot ping) other IPs on my local network, only the internet!. 
    My local office network is DSL hooked up to a SonicWall gateway then a MS SBS 2011 server acting as local DNS and DC.  After trying every configuration and command I can find here in these forums, I can only get on the network using dhcpcd.  Also, on only a couple occasions I was able to ping the server by IP, but still can't get resolution from the local DNS.  I don't think it's because of my local network config, I have a solaris box that joins my local net and can ping any and everything on it as well as use the local DNS.
    Questions:
    1. Why does static IP assignment not work.  I've tried in rc.conf as well as "ip addr" and "ip route" commands, and made sure resolv.conf is good..  Only dhcpcd gets me connected.
    2. Why do I not get service from my local private network's DNS once dhcpcd gets me on the network? 
    3. And why can I not ping other IP's on my local network once dhcpcd get's me connected.
    (after a fresh boot)
    # ip addr
    1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
        link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
        inet 127.0.0.1/8 scope host lo
    2:
    eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN qlen 1000
        link/ether 00:1b:21:d9:72:bc brd ff:ff:ff:ff:ff:ff
        inet 10.0.1.200/24 brd 10.0.1.255 scope global eth0
    3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
        link/ether 00:1b:21:d9:72:bd brd ff:ff:ff:ff:ff:ff
    4: eth2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
        link/ether 00:25:90:62:9a:ea brd ff:ff:ff:ff:ff:ff
    5: eth3: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
        link/ether 00:25:90:62:9a:eb brd ff:ff:ff:ff:ff:ff
    (after a manual ip addr add <IP> dev eth3, still no network connectivity)
    1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
        link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
        inet 127.0.0.1/8 scope host lo
    2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN qlen 1000
        link/ether 00:1b:21:d9:72:bc brd ff:ff:ff:ff:ff:ff
        inet 10.0.1.200/24 brd 10.0.1.255 scope global eth0
    3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
        link/ether 00:1b:21:d9:72:bd brd ff:ff:ff:ff:ff:ff
    4: eth2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
        link/ether 00:25:90:62:9a:ea brd ff:ff:ff:ff:ff:ff
    5: eth3: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
        link/ether 00:25:90:62:9a:eb brd ff:ff:ff:ff:ff:ff
        inet 192.168.168.36/24 scope global eth3
    (so I do an ifconfig eth3 up, looks better, but still not talking on network)
    eth0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500  metric 1
            inet 10.0.1.200  netmask 255.255.255.0  broadcast 10.0.1.255
            ether 00:1b:21:d9:72:bc  txqueuelen 1000  (Ethernet)
            RX packets 0  bytes 0 (0.0 B)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 0  bytes 0 (0.0 B)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
            device memory 0xfa3e0000-fa400000 
    eth1: flags=4098<BROADCAST,MULTICAST>  mtu 1500  metric 1
            ether 00:1b:21:d9:72:bd  txqueuelen 1000  (Ethernet)
            RX packets 0  bytes 0 (0.0 B)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 0  bytes 0 (0.0 B)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
            device memory 0xf97e0000-f9800000 
    eth2: flags=4098<BROADCAST,MULTICAST>  mtu 1500  metric 1
            ether 00:25:90:62:9a:ea  txqueuelen 1000  (Ethernet)
            RX packets 0  bytes 0 (0.0 B)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 0  bytes 0 (0.0 B)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
            device interrupt 16  memory 0xfbce0000-fbd00000 
    eth3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500  metric 1
            inet 192.168.168.37  netmask 255.255.255.0  broadcast 192.168.168.255
            ether 00:25:90:62:9a:eb  txqueuelen 1000  (Ethernet)
            RX packets 1567  bytes 131544 (128.4 KiB)
            RX errors 0  dropped 1  overruns 0  frame 0
            TX packets 13  bytes 1454 (1.4 KiB)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
            device interrupt 17  memory 0xfbde0000-fbe00000 
    lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 16436  metric 1
            inet 127.0.0.1  netmask 255.0.0.0
            loop  txqueuelen 0  (Local Loopback)
            RX packets 290  bytes 22392 (21.8 KiB)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 290  bytes 22392 (21.8 KiB)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    (here's my resolv.conf - these IP's are good, I backed it up and make sure it's these values before I do the manual ip addr  they work once dhcpcd is run)
    # Generated by dhcpcd from eth3
    # /etc/resolv.conf.head can replace this line
    nameserver 192.168.168.199
    nameserver 192.168.168.150
    nameserver 68.94.157.1
    # /etc/resolv.conf.tail can replace this line
    (here's what I had in my rc.conf, it doesn't assign anything on a fresh boot)
    # /etc/rc.conf - Main Configuration for Arch Linux
    # LOCALIZATION
    # LOCALE: available languages can be listed with the 'locale -a' command
    # HARDWARECLOCK: set to "UTC" or "localtime", any other value will result
    #   in the hardware clock being left untouched (useful for virtualization)
    # TIMEZONE: timezones are found in /usr/share/zoneinfo
    # KEYMAP: keymaps are found in /usr/share/kbd/keymaps
    # CONSOLEFONT: found in /usr/share/kbd/consolefonts (only needed for non-US)
    # CONSOLEMAP: found in /usr/share/kbd/consoletrans
    # USECOLOR: use ANSI color sequences in startup messages
    LOCALE="en_US.UTF-8"
    HARDWARECLOCK="UTC"
    TIMEZONE="UTC"
    KEYMAP="us"
    CONSOLEFONT=
    CONSOLEMAP=
    USECOLOR="yes"
    # HARDWARE
    # MOD_AUTOLOAD: Allow autoloading of modules at boot and when needed
    # MOD_BLACKLIST: Prevent udev from loading these modules
    # MODULES: Modules to load at boot-up. Prefix with a ! to blacklist.
    # NOTE: Use of 'MOD_BLACKLIST' is deprecated. Please use ! in the MODULES array.
    MOD_AUTOLOAD="yes"
    #MOD_BLACKLIST=() #deprecated
    MODULES=(8021q autofs4)
    # Scan for LVM volume groups at startup, required if you use LVM
    USELVM="no"
    # NETWORKING
    # HOSTNAME: Hostname of machine. Should also be put in /etc/hosts
    HOSTNAME="mg"
    INTERFACE="eth3"
    ADDRESS="192.168.168.38"
    GATEWAY="192.168.168.168"
    BROADCAST="192.168.168.255"
    # Enable these network profiles at boot-up.  These are only useful
    # if you happen to need multiple network configurations (ie, laptop users)
    #   - set to 'menu' to present a menu during boot-up (dialog package required)
    #   - prefix an entry with a ! to disable it
    # Network profiles are found in /etc/network.d
    # This now requires the netcfg package
    #NETWORKS=(main)
    # DAEMONS
    # Daemons to start at boot-up (in this order)
    #   - prefix a daemon with a ! to disable it
    #   - prefix a daemon with a @ to start it up in the background
    #DAEMONS=(syslog-ng dbus acpid autofs  firewall setup-bonding network crond aide cupsd)
    DAEMONS=(syslog-ng dbus acpid autofs  firewall network crond aide cupsd)
    Last edited by Mogombus (2012-04-09 02:35:55)

    Okay, somewhere in there, you plugged a cable into eth0 and it acquired a private network address in the 10.xx.xx.xx space.
    Can you verify you are assigning a static address to eth0 of 192.168.168.37 ?  That is an unusual address. Are you sure you are on the correct subnet?
    What was the output of ip route when you thought you should have been able to hit the net?
    What is the gateway address for eth0 ?
    Can you describe the network attached to eth0?  (It seems to be a 10.xx.xx.xx private address)
    Can you describe the network attached to eth3?  (Is it a local router ? )
    Last edited by ewaller (2012-04-09 14:50:10)

  • Invoke Save Content on Assigned TextFrame

    Hi,
    I'm trying to solve one situation... when assigned story is in status "In use and out of date". This one is quite disturbing for client (even more for developer) and could lead to unwanted direction like - getting back the old content and loosing any modification which you entered. If you want to reproduce it, it is very easy:
    1. Create incopy assigned text frame
    2. Save it, save document
    3. Check Out the Story
    4. Enter some content
    5. Save document
    --- at this point everything is cool and status of Story is "In Use"
    6. Enter content and hit "UNDO"
    --- at this point you get "In Use and Out of Date" status
    One solution to solve this is that you just hit Save and Assignment is "In use" status or you could do Save Content from Edit->InCopy menu or from "right click on text frame" pop-up menu just for that Story.
    Now, the question is... is there a solution to do "Save Content" by scripting... no metter what is selected at that point. Something like:
    For (Browse through all Assignments)
    --- If (Assignment is in status "In use and out of date")
    --- --- Do the Save Content for that Assignment
    --- End If
    Next
    And just to be clear - not to use the InvokeMenu method.
    Thanks!
    Marko

    Hi Jarek,
    I agree that "out of date" status is very needed and shows to client if the change is made to TextFrame... but take a look again in that little icon over the frame (my screenshot)...
    The icon says - "In use and out of date"... this is situation from InDesign which you can reproduce without another user doing check out/check in in InCopy. So - only you and nobody else. The icon means that you are editing the content of the frame and in the same time - your content needs an update?!
    Just to mention that this situation I couldn't reproduce in InCopy. Here you will find very simple explanation about this icon and some comments.
    http://incopysecrets.com/the-strange-case-of-the-editing-and-out-of-date-status.php/commen t-page-1
    And because you can not be absolutely sure that client will not hit Save and Undo, I would like to implement in my editorial system workflow, a peace of code which will check the assignments and when spot that status -> do something... alert, message, save content, save doc or else...
    I would appreciate if someone could provide me even with little help on how to catch this status in InDesign.
    Regards,
    Marko

  • Trouble assigning an App to a desk top

    I have set up about 9 desk tops for my most used applications and most of the time it works really well. But occasionally I open an application and it opens on a desk top that it is not assigned to.
    An example is Excel for mac.
    Excel that is assigned to Desk top #3, i open the file from finder that is on Desk top #1. The screen then gets swept over to Desktop #3 and the excell tool pallet and menu bar opens but the actual spread sheet is still on Desktop #1. I can also go back to Desktop #1 and start editing the spread sheet there. 
    It is not just because it is a microsoft application i get the same sort of thing happening in apple's applications like Numbers.
    I didn't have this problem with spaces in Snow leopard
    Does anyone else encounter this problem, and does anyone else have a solution?
    If you need for information for me to describe this problem let me know and i will try and clarify it.
    Thank you
    Adam

    Is the Application installed? if so you may need to use the uninstaller that came with it. look in the Applications folder for the application and its unistaller. If it is installed and there is no uninstaller you should be able to drag the app to the trash, as long as the application is not open.
    Sometimes applications that are on the desktop are not the application but the application image file or dmg file, that is used to install the application. Does the file on your desktop end with dmg, like xxxxxx.dmg ? If it does, go to the finder app and look for that file in the left column in the DEVICES sections. The click the eject icon to dismount it. Then ou can drag the xxxxxxxx.dmg file from the desktop to the trash.

  • 10.8, trouble assigning apps to a space

    I am having an issue assigning some apps to a space. Some apps, < when right clicked and options selected > are fine. The sub menu is there for them and I can set as none, all or this desktop, as usual.
    But some apps the submenu just isn't there.  Sometimes it does show up eventually and some never.  Any clues??
    This is a fresh install on a new Macmini, with a SSD for the system and the apps folder symlinked from the hard drive. However, that doesn't seem to be the issue since all my apps run from the hard drive and some work fine.
    Weird
    Thanks for any assistance.
    John

    I am having an issue assigning some apps to a space. Some apps, < when right clicked and options selected > are fine. The sub menu is there for them and I can set as none, all or this desktop, as usual.
    But some apps the submenu just isn't there.  Sometimes it does show up eventually and some never.  Any clues??
    This is a fresh install on a new Macmini, with a SSD for the system and the apps folder symlinked from the hard drive. However, that doesn't seem to be the issue since all my apps run from the hard drive and some work fine.
    Weird
    Thanks for any assistance.
    John

  • Trouble assigning security filters in Shared Services

    In Shared Services/Application groups - right click on database to "Assign Access Control" and get the following error "Cluster Name specified is invalid" Anyone seen this one before? - thanks.

    Hi,
    are you sure you configuration of Essbase and Shared services went on fine?
    does your essbase cluster name during configuration contains special characters?

  • Having trouble assigning the Data Type to Shared Variables

    I have some type definitions that I need to use as shared variables.  When making the shared variable, I create it and then name it.  I then select "From Custom Control..." in the Data Type field and select the applicable type definition.  The problem is that it displays some other type definition.  Am I doing something wrong?  I am using LV v.8.6. I don't recall having this problem with v.8.5.1.

    Hi Hunter,
    All the custom controls are set to Type Def.  Since sending my question, I noticed that the system uses the first similarly used custom control and it's name.  For example, I have several clusters that each have four numeric controls in them.  When creating a shared variable for each of the various clusters, it uses the first custom control that was set up as a shared variable.  I hope this makes sense to you.  I have not had a chance to see if the shared variables are working because I have other issues to deal with first. 
    What troubles me is that I don't recall seeing this with v.8.5.1.
    I suppose I could and perhaps should use a common type def for all similarly used shared variables.
    Dave

  • Trouble assigning images to FCPX Scrapbook Theme

    I'm trying to use the 'Pan far right' transition / theme in FCPX.
    It is automatically picking up images either side of the position I've inserted it into in the timeline, but I'm not able to change or add additional images to it.
    Searching under FCPX help brings up the relevent topic 'Adjust Transitions with multiple images' which suggests that I should be able to identify the images which have been used in the theme via numbered 'handles' in the timeline, and that by dragging these handles I can change / assign images from the timeline to the corresponding numbers in the theme.
    My problem is that I can't see the numbered handles in my timeline (see screenshot attached)
    Any help much appreciated.
    Simon

    Hello Tom,
    thanks for the reply - I quickly checked and the transition with the scrubber through it is in fact selected - just when I toggled to the screen capture tool the yellow marquee indicating selection faded out.
    I've been able to view the missing handles by creating a new project (screen shot attached below) but I just can't figure out why the handles are not viewable in the original project.

  • Trouble with textframes from word files

    I received yesterday a article written in word. When I open that file in Pages 08, Pages warns that textframes are not supported. I could find such textframes in the header area where the author created page numbers in. My fault is, that I can miss the pagenumbers as I create them new in Pages, but other as Pages warned the pagenumbers created in word in the textframes are still in the pages document and can not removed. I see them only and they are still there when I export that Pages file to PDF. How may I remove such contend in Pages?
    A second error is in this file too: All footnotes are marked as endnotes. This should be. But if I mark all endnotes to be as chapterendnotes, there is a small line on top of the first endnote right after the last textline and this small lie comes on top of each page, where the endnotes are. For example, in my case there are about 50 endnotes and they flow over three pages and below the headline but before the first endnote on each page there is the short line. How do I remove the lines?
    And another small fault I can see: I select endnotes at the end of document. I do have a headline before of the endnotes like "Annotations" or so. The headline has on top a space of 18 pt and below to the next text a space of 12 pt. In case of using endnotes at the end of document the space below the headline and before the first endnote is missing. The first endnote comes right after the headline. How do I get a space before the endnotes?

    Hi,
    function(){return A.apply(null,[this].concat($A(arguments)))}
    dragonfly52 wrote:
    Use Windows 7; ---; Acrobat Pro 9.0.0
    Acrobat compatibility for Windows 7 starts with Acrobat 9.2.
    See: http://www.adobe.com/products/acrobat/faq/
    The first step may be to place the installed Acrobat 9.x to the current dot release via sequence install of available updates, .
    http://www.adobe.com/support/downloads/product.jsp?product=1&platform=Windows
    Be well...

  • Having trouble assigning "buttons" to mute certain tracks on&off

    I can assign all the faders and trim knobs on my "Novation reMOTE sl61;" but i cant seem to assign any of the "buttons" on my device to map the sameway i can get the other knobs and faders to map on my device.
    I want to make sure what I'm doing can even be done in Mainstage for one. What i have is a concert with 2 vocal tracks and a midi keyboard track. what im trying to do is i add a "button" parameter in the "workspace" section. and im trying to map that button to mute one of the vocal tracks on and off.
    I have sucessfully mapped the button to mute the track on and off by using the mouse click in the workspace section. but the button on my device still wont map, which is what i need it to do.
    What should i Do?

    Yea it does, but this is when midi mapping gets a little confusing for me.
    this is what im working with here. It says that the number is 40(#08lsb) and when i press it the numbers underneath the highlighted button say "40" and "0" underneath the "40" and the "0" changes to a "1" when i press it. but i still cant get the button to illumitate or trigger what i want it to.

  • Trouble assigning sub class to super class array

    Hi,
    I would greatly appreciate some help with the following:
    I want to assign a sub class to a super class array but the following code does not work
    where the board is comprised of the super class
         private static void makeMove( int X, int Y, int moveX, int moveY )
              ChessPiece tempChessPiece = ( ChessPiece ) board[ X ] [ Y ];
              board[ X ] [ Y ].setType( UNDEFINED );
              board[ moveX ] [  moveY  ] = tempChessPiece;
         }

    I have got this code to work but it does not appear
    to be very efficient to me as i dont recycle the
    objects.
    Any thoughts?The objects will be recycled by the garbage collector. It's very efficient so there's very little performance penalty in creating objects and releasing objects.
    Still, another alternative is to represent an empty square with null. In that case the code becomes,
    private static void makeMove( int selectedX, int selectedY, int moveToX, int moveToY ) {
       board[moveToY][moveToX] = board[selectedX][selectedY]; // piece to new position
       board[selectedX][selectedY] = null; // remove from old
    }I don't know your exact design but that should work. It's kind of natural too. If a square is empty there's no piece object there at all. No new object has to be created and that explicit cast is gone.

  • I'm having trouble with "this" and method dependence

    For my Data Structures course, we have to create a simple Word Processor. The constructor contains two stacks, left and right. The way the class populates the strings is pretty straight forward. Any text to the left of the cursor gets pushed onto the left stack and any text to the right of the cursor gets pushed onto the right stack (in reverse order). For example, the phrase "hello" with the cursor between the l's, would push h, then e, then l onto the left stack. o then l is pushed onto the right stack. Follow me so far?
    Next, we have to implement several methods, such as moveLeft, moveRight, delete, insert, and moveToStart. There is also a toString() method which prints the two stacks as a String. The way I have my toString() method mapped out, is first to call the moveToStart() method. This method then pops all values from the left stack and pushes them onto the right stack (left: empty, right: h-e-l-l-o). So now, I simply pop each value from the right stack and store the values in a char[] array. The array is then returned as a String.
    This data structure converts the stacks to a String fine, the only problem is preserving the original stacks. So I tried to copy the value of "this," which should correlate to the EditableString es2 (declared in main), to a temp EditableString, tempEs. I then call moveToStart on tempEs, and pop values from tempEs.right. This is all in hopes to preserve the original es2. However, as you could see from the output at the bottom is that toString() modifies es2. If it didn't, "Hello, how are you" would have printed twice. Instead, an empty string is printed.
    There is obviously something wrong with my moveToStart(). Any suggestions? I apologize for not providing any comments in the code, it's just that I tried to save space. If any further explanation is necessary, don't hesitate to ask. Thanks.
    public class EditableString {
    private Stack left;
    private Stack right;
    private JavaStack l = new JavaStack();
    private JavaStack r = new JavaStack();
    private char[] text;
    private static String cursor = new String("|");
    private EditableString tempEs;
    private Character characterObject;
    private char test1;
    public EditableString() {
    left = new JavaStack();
    right = new JavaStack();
    public EditableString(String left, String right) {
    new EditableString();
    for (int i=0; i < left.length(); i++) {
    characterObject = new Character(left.charAt(i));
    l.push(characterObject);
    for (int i = right.length(); i > 0; i--) {
    characterObject = new Character(right.charAt(i-1));
    r.push(characterObject);
    this.left = l;
    this.right = r;
    public void moveToStart() {
    while (! this.left.isEmpty())
    this.right.push(this.left.pop());
    public String toString() {
    tempEs = this;
    tempEs.moveToStart();
    text = new char[(tempEs.right).size()];
    for (int i=0; i < text.length; i++)
    text[i] = ((Character) (tempEs.right).pop()).charValue();
    return new String(text);
    public static void main(String args[]) {
    System.out.println("Starting Word processor!");
    System.out.println("----------");
    EditableString es2 = new EditableString("Hello, how", " are you");
    System.out.println("es2: " + es2.toString());
    System.out.println("es2: " + es2.toString());
    /* Output:
    Starting Word processor!
    es2: Hello, how are you
    es2:
    */

    Ok, I tried to create a copy(Es) method and modified the toString() method as follows, but I am having the same problem. Ok, in order to test my methods, I print the various sizes of several stacks. In the toString() method, right after tempEs is declared, this.left=10, this.right=8 and tempEs.left=tempEs.right=0. After the copy method is invoked and assigned to tempEs, this.left=tempEs.left=10 and this.right=tempEs.right=8. Follow me?, this is where I have trouble.
    I try to "pop" one value from tempEs.right to see if the action occurs on tempEs and not this. Well, it does. Right after the pop() method, this.left=tempEs.left=10 and this.right=tempEs.right=7. I need this.right to stay at 8. Why are these Editable Strings dependent?
    And for the record, I'm not trying to "pay" anyone to do my homework. I am simply trying to pass, and in turn, graduate. This is the second time I am taking this course (failed it with style the 1st time) and desperately need to pass. I have VERY little Java background and this class is unfortunately required for my engineering degree. So, I am simply looking for some help with my 30+hour homework assignments.
    public EditableString copy(EditableString ES) {
            EditableString xTemp = new EditableString();
            xTemp.left = ES.left;
            xTemp.right = ES.right;
            return xTemp;
        public String toString() {
            EditableString tempEs = new EditableString();
            tempEs = copy(this);
            tempEs.right.pop();
            tempEs.moveToStart();
            text = new char[(tempEs.right).size()];
            for (int i=0; i < text.length; i++)
                text[i] = ((Character) (tempEs.right).pop()).charValue();
            return new String(text);

  • Spacing between characters too large when using line justification !!!!

    Dear friends,
    Since the first time when I have used Pages I noticed a somewhat annoying feature: Sometimes when I use line justification (left and right) the spacing between the characters increase substantially. Sometimes the spacing is ridiculously large. I guess that I have mad something wrong, but I do not know what. Can someone give me a hint what I should do to overcome this irritating aspect?!
    Thanks in advance
    LJ

    There is no doubt that Mellel is a much better application than Pages in a lot of areas. It has been around for longer, it is more mature and it is actively maintained. Pages is of course better in a lot of other areas - and there is room for both on the market.
    Mellel handles hyphenation in a much more advanced way than Pages and it has support for example for soft-hyphens, editable hyphenation dictionaries and hyphenation zones - something Pages lacks.
    When it comes to the large space between characters, however, I cannot say that Mellel has invested a lot in making it look good. They just chose the simplest solution, just like MS Word, to increase space between words - not between characters. They even use this as an example of something ugly in Mellel's own user guide: "For example, the following text is fully justified but not hyphenated. The spaces between the words look wide and make the text look quite ugly."
    As mentioned before, in some cases increasing space between words is the most pleasing solution to the eye. In some cases adding some space between characters is more pleasing, and that is the reason why Apple went to the extra trouble of adding that functionality. In many cases, it is not obvious which way is best, and people will have diverging opinions.

  • Left-aligning text in Final Cut 7

    I am using Final Cut Pro Version 7.0.3, doing mostly subtitles for TV series.
    Because of the amount of titles done daily, and because we left-align around 30% of all our subtitle text, I would save a lot of time if there was a keyboard shortcut to left-align text in the subtitle clips.
    Text Settings under the Control tab in the Viewer, automatically chooses Center Alignment, which is fine, but how can I left-align text without having to choose from the Alignment options? I could not find this option in the keyboard layout, so I could not assign a key for left-alignment.
    Does anyone know how to do this?

    This is not a direct answer to your question, but in my experience most FCP-7 users don't use the Text option in text intensive projects. As you have discovered, the Text options are limited.
    Instead they use Boris Title 3D which is bundled in FCP-7:
    Boris Title 3D gives you much more control over your text, and defaults to left justification:
    You might take a look and see if using this tool (which Apple provided to address the shortcomings of the Text generator) can help you.
    MtD

Maybe you are looking for

  • Need a JavaScript to enable/view Multi-line option for Text fields.

    Hello All, I need a JavaScript to enable/view Multi-line option for all the Text fields in PDF Form. Assume that I have a PDF form of Fields from F1 to F100 and it contains 25 Checkboxes, 25 Combo Box and 50 Text Fields. Now i need a javascript for w

  • Just Upgraded to Snow Leopard and ruined Logic - Help!

    I'm running Logic 8, NI Komplete and Reason 4.0. All was dandy under 10.5.8. Upgraded to snow leopard last night and all apps were fine....except logic. I opened logic and it went to rescan all the AU. Fine, let it go a few mins but seemed to be hang

  • Application Engine Server process dies on Windows

    Hi experts, We developed an AE in which employee data will be calculated and inserted to HR core table via CI. We started multiple instance of the AE by people code, most of them will success but others run into error and reported "Process XXX is mar

  • What is Apple support?

    Help!  I cannot get my iPad 2 to work with Safari since the iOS 8 update.  And where is Apple to support this product?  I am typing on my HP laptop and may never go back to Apple again!

  • Backing up actions - Not working after re-install.

    I recently had hard drive issues that led to PC issues so I decided to do a full re-install of Windows 8.1 and all my programs. After installing Ps CS6 64-bit, when I loaded my backed up actions into Ps, some of my actions would not work.  Giving me