ID cs6:How to Fit Frame to Version heart(or Page) with script?

More times, I need my Frame fit to my Version,or fit to my page,
I looking for the scrip in the Internet, only see "frames  to content"
Who would like to help me?
Thank you very much~

Hi  Kai Rübsamen
Thank  you very much.
Some times I must press Ctrl+Z, It will  be ok?
and ,I want to select more than one text frame.
and, the script is wrong in some document ,Tested, I find  should be make the Coordinate origin to the The upper left corner
Could you like to add this Function into the scrip.
thanks
fit to margins
var curDoc = app.activeDocument;
if ( app.selection.length != 1 ) {
    ( alert ( "Something wrong with your selection!" ) );
    exit();
var curSel = app.selection[0];
var curPage = curSel.parentPage;
var rO = curDoc.viewPreferences.rulerOrigin;
if (rO != 1380143215) {
    curDoc.viewPreferences.rulerOrigin = RulerOrigin.pageOrigin;
var pW = curDoc.documentPreferences.pageWidth;
var y1, x1, y2, x2;
if ( curPage.side == PageSideOptions.leftHand ){
    x2 = curPage.marginPreferences.left;
    x1 = curPage.marginPreferences.right;
else {
    x1 = curPage.marginPreferences.left;
    x2 = curPage.marginPreferences.right;
x2 = pW - x2;
var gB = curSel.geometricBounds;
// fit to margins
gB[1] = x1;
gB[3] = x2;
curSel.geometricBounds = gB;
curSel.fit ( FitOptions.FRAME_TO_CONTENT );
resetAsBefore();
function resetAsBefore() {
    if ( rO != 1380143215 ) {
            curDoc.viewPreferences.rulerOrigin = rO;
fit to page
var curDoc = app.activeDocument;
if ( app.selection.length != 1 ) {
    ( alert ( "Something wrong with your selection!" ) );
    exit();
var curSel = app.selection[0];
var curPage = curSel.parentPage;
var rO = curDoc.viewPreferences.rulerOrigin;
if (rO != 1380143215) {
    curDoc.viewPreferences.rulerOrigin = RulerOrigin.pageOrigin;
var pW = curDoc.documentPreferences.pageWidth;
var y1, x1, y2, x2;
if ( curPage.side == PageSideOptions.leftHand ){
    x2 = curPage.marginPreferences.left;
    x1 = curPage.marginPreferences.right;
else {
    x1 = curPage.marginPreferences.left;
    x2 = curPage.marginPreferences.right;
x2 = pW - x2;
var gB = curSel.geometricBounds;
// fit to page
gB[1] = 0;
gB[3] = pW;
curSel.geometricBounds = gB;
curSel.fit ( FitOptions.FRAME_TO_CONTENT );
resetAsBefore();
function resetAsBefore() {
    if ( rO != 1380143215 ) {
            curDoc.viewPreferences.rulerOrigin = rO;
best wishes

Similar Messages

  • How to fit text layer to extents of comp with scripting?

    Hi There,
    I'm trying to do something relatively simple, but am having trouble figuring out why it's not working.  I want a script that scales a text layer to the correct size so that it fits the extents of its parent comp.  I have found a couple of resources that do this, but I think these scripts assume that AE is running with its GUI.  In my case, I'm running afterfx.exe from a batch script with the -noui switch.  So, when running AE with the -noui switch, it seems that using the app.executeCommand() function doesn't seem to work right.  Here are the threads I found for handling exactly what I want, but that both incorporate the app.executeCommand() method:
    http://www.aenhancers.com/viewtopic.php?f=8&t=150&start=45
    and
    http://aenhancers.com/viewtopic.php?f=8&t=150&start=60
    Does anybody have any other suggestions for writing a script that fits a text layer to size, or are these the only alternatives out there?
    Thank you for your time and help!

    You don’t need to use app.executeCommand() for that any more. Something like this should work:
      var myComp = app.project.activeItem;
      var myLayer = myComp.layer(1);
      var myRect = myLayer.sourceRectAtTime(0,false);
      var myScale = myLayer.property("Scale").value;
      var myNewScale = [myScale[0]myComp.width/myRect.width,myScale[1]myComp.height/myRect.height];
      myLayer.property("Scale").setValue(myNewScale);
    Dan

  • How much does windows 7 version that is used with boot camp?

    hello everybody
    combien coute une version windows 7 que l'on utilise avec boot camp?
    how much does windows 7 version that is used with boot camp?
    thanks

    Wait for Windows 8 2012-10-25 and use the free Preview or Trial version for now is another option.
    Windows 8:
    http://msdn.microsoft.com/en-us/windows/apps/default
    https://blogs.msdn.com/b/b8/
    http://www.zdnet.com/blog/hardware/windows-8-an-installation-walk-through/14768
    http://www.gizmodo.com.au/2012/03/windows-8-on-a-macbook-air-beautiful-and-kinda -broken/

  • How to fit the footer always to bottom page

    How to fit the footer always to bottom page.
    Regards

    Well, this is relatively simple. There are blue lines on your page with little blue squared arrows on each side. Hover your mouse over them to find out which ones define "Bottom of Page" and "Footer" (you will also see some towards the top of the page for Header). Adjust these so that the "Bottom of Page" line is quite literally the bottom of the page and move the footer one higher about 2 inches or so, depending on how big you want your footer to be. This automatically will define a footer to stay consistantly on the bottom of your page(s) throughout the site even when expanding or shrinking window sizes. Just another great feature of Adobe Muse

  • HT4550 Why does my Safari open with American version and home page with Apple iPhone 5 advert even though I have changed them in preference

    Why does my Safari open with American version, and home page with Apple iPhone 5 advert even though I have changed them in preferences, it happens every time no matter how many times I change them, when I open Safari its back to the USA and Apple home page.

    Try this.
    Hold the shift key down and launch Safari.
    Best.

  • How to create a new Oracle OSB project automaticaly with script without IDE

    Hello,
    I want to create automatically an "Oracle service bus project" and an "Oracle service bus configuration project" with scripts (ANT or Maven or ...) without using IDE, without using workshop or Eclipse. I want to create automatically (ANT or Maven) just a skeleton of an OSB project witch i can use after in workshop.
    I want to create 1 "Oracle service bus configuration project" with many "Oracle service bus project" automatically (ANT or Maven or scripts) witch i can use after in workshop. How to create a new Oracle OSB project automaticaly with script without IDE ? How can i do this ?
    I'm using Oracle service bus 10.3.1
    Thank you for your help.

    Thank you for your response,
    I do not want to just create the services (proxy services and business services) but I want to create a template for 40 OSB project with the same scripts ANT/Maven.
    Template="Oracle service bus configuration project" + "Oracle service bus project" + services of 40 OSB projects
    The goal is that I have more than 40 projects to create and just the name of the projects that changes (when I say the name of the project ie the name of the OSB project, the name of proxy services and the name of business services ).
    So I want to give my script (ANT/Maven) the name of 40 OSB project and the script must generate the skeleton of the 40 projects at once time and after generation of skeleton of the 40 project, I will import them in the workshop to add manually mapping and routing and other things that differs from one project to another.
    So i want to generate automatically a skeletons of 40 OSB projects using a script (ANT / Maven) and I give to the script juste the names of the 40 projects.
    I want to create a "Oracle service bus configuration project" and "Oracle service bus project" automatically of 40 OSB projects (ANT or Maven or scripts) witch i can use after in workshop.
    I want to create one 'template' of all 40 projects in the same time, with the same directory structure (Transforlation, Business services, proxy services, WSDL .....) and all 40 project have the same transport, just the names of projects and services witch changes and i can give to the script all names of projects and services and i can give also all WSDL.
    Regards,
    Tarik

  • I am a new iPad Air user. How do I get back to the home page with all the icons.

    I Am a new user. How do I get back to the home page with all the icons.

    iPad Manual
    http://manuals.info.apple.com/en_US/ipad_user_guide.pdf

  • Find a text frame on the page with script label

    hello to all
    I need to create a script to
    find a text frame on the page with script label "xxx"
    and read its contents into a variable.
    The content of the text frame is a number.
    thanks

    Hi Roberto,
    Welcome to the forum,
    This will find the labeled textFrame on the active page.
    var myLabel = "Foo", // change to label
          myPage = app.properties.activeWindow && app.activeWindow.activePage,
          myTextFrames = myPage.textFrames.everyItem().getElements().slice(0),
          l = myTextFrames.length,
          myVariable
    while (l--) {
        if (myTextFrames[l].label != myLabel) continue;
        myVariable = myTextFrames[l].contents;
        break; // presuming there's only one "Foo" labeled frame on the page
        // Otherwise you'll nead an array
    alert(myVariable)
    Trevor

  • How to fit frame to content when content contains anchored text box?

    Hi there
    I am creating a series of inline text frames within a text frame. Each of these inline frames contains text which includes an anchored text frame. If I tell my inline frames to fit to content they seem to ignore the anchored frames contained therein. Is there any way I can get them to consider the anchored frames they contain when they fit to content?
    I tried checking the geometric bounds of my anchored frame before and after its parent frame has fitted to content. Even when there has been no change in position the bounds after fitting to content seem to give numbers way off. I thought I might be able to reset the geometric bounds of the containing frame manually if the anchored frame therein had moved with the fit frame to content.
    Here is a snippet of my code:
    var anchoredBounds = anchoredFrame.geometricBounds;
    mainFrame.fit(FitOptions.FRAME_TO_CONTENT);
    mainFrame.texts.item(0).recompose;
    var newAnchoredBounds = anchoredFrame.geometricBounds;
    alert(anchoredBounds[0] + "; " + newAnchoredBounds[0]);
    So “mainFrame” is the text frame containing text and the anchored frame, “anchoredFrame”. “anchoredBounds[0]” seems to correlate with the top edge of the frame when I check it manually after the script has finished (when it hasn’t move with the fit to content). “newAnchorBounds[0]”, however, always gives numbers that are way off every time. Any ideas why this would be the case?
    And most importantly, can anyone suggest how I can get my “mainFrame” to consider the “anchoredFrame” contained in it when it fits to content?
    I’m using CS4 on a PC. Let me know if it would help to post more code, or if I haven’t explained myself clearly enough.

    Is there any way I can get them to consider the anchored frames they contain when they fit to content?
    @Graham – as long as ALL the anchored text frames are "inline" text frames,
    mainFrame.fit(FitOptions.FRAME_TO_CONTENT);
    should work as expected or at least sort of *.
    Without calculating anything at all.
    Just tested in InDesign CS5.5 (v7.5.3).
    Could it be that CS4 will fail on that?
    Of course, you can only rely on this, if the main text frame contains any "real" text at all. Not only the  special characters representations of the "inline" text frames. In that case the fit() method will do nothing at all.
    * it's debatable, if the fit() method yields desirable output.
    It depends on your expectations.
    See the following examples:
    1. Case 1:
    Text frame before fitting:
    2. Case 1:
    After fitting with the UI command, context menu: "fit frame to contents"
    (note the gap between the last baseline of the text and the text frame; note also  the new width)
    Is that the result you would expect? I guess not.
    3. Case 1:
    After fitting  programmatically with myTextframe.fit(FitOptions.FRAME_TO_CONTENT);
    4. Case 2:
    Before fitting
    same text frame as in #1, but different height
    5. Case 2:
    After fitting with the UI command, context menu: "fit frame to contents"
    A different width than in #2 and a gap at the bottom of the text frame!
    Not the desired result, I'd say…
    6. Case 2:
    After fitting  programmatically with myTextframe.fit(FitOptions.FRAME_TO_CONTENT);
    Same result as in #3
    So with scripting we could, at least, get consistent results.
    Of course, you could get the same results in the UI, if you double-click on the bottom center control point…
    Maybe it helps, if you are showing us some screen grabs:
    1. Your starting point
    2. The desired result
    Uwe

  • How do I know what version of linux comes with terminal

    Essentially I want to convert a PC Bat file into a Unix script so I can run the same process on my Macbook Pro.

    No you're question wasn't to vague, I was able to get the basic idea of what you were asking.
    As for an automatic way to convert bat scripts to shell scripts, I won;t say there isn't something out there, out there is a big place, but I doubt it. As I wrote the differences between the systems make a direct conversion difficult.
    On OS X you have two choices for scripting, shell scripts and Applescripts. Shell scripts are your basic Unix command files, are created in a text editor and run from the Terminal command line.
    Applescripts are created with the Applescript editor, have a tighter link with OS X, and are run from the GUI.
    (all of that is very basic and there are exceptions to what I wrote but that is the intro version)
    If you have a script from Windows that did something that you would like to have done on OS X you can transfer the what but not the how. That is you can do the same thing (automate backups in this case) but how you go about that will be different.
    If you;re intereested in learning scripting on OS X (either shell or Applescript) this could be a good project to start with. You know what you want you just have to figure out how to do it in OS X now. If this is the case I'd suggest you start a new thread in the Mac OS X Technologies group. That is where scripting is usually discussed.
    good luck
    regards

  • How to reload frame in Safari? Reloading page does not refresh all frames

    I have IPAD Air. In Safari, reloading a page does not automatically refresh all frames. Is there a way to force a frame reload/refresh?
    This is true in other browsers, IE, Chrome, etc, that is reloading a page does not automatically fresh all frames. However, they all have a reload frame option.
    How can I do that in Safari?

    A frame is not a browser tab. A web page is made up of multiple frames. 'frame' is the standard HTML definition of the frame tag. Here is a html example, which specifies a web page that subdivides into 6 frames. Each frame links to a html page.
    In Safari, updating a page does not automatically updates all the frames. In all other browsers, you can put the mouse on a frame, right click, and select the 'reload frame.' option.
    My question is how to updat frames in Safari? One way that works, of course, is to go to IPAD Setup, select Safari, and flush the Safari cache, but that's very inconvenient.
    |                                                    |
    |                                                    |
    |                                                    |                 
    |                                                    |
    |                                                    |
    |          |                              |          |
    <frameset rows="45,50,*,60" frameborder="0" border="0" framespacing="0">
    <!--  <frame name="topNav" src="top_nav.html" target="_self"> -->
      <frame name="topNav" src="top_nav.html" target="_self">
      <frame name="menu" src="menu_1.html" target="_self">
      <frame name="content" src="../TaishaneseChopSuey/transcription.html">
    <frameset cols="200,*,300" frameborder="0" border="0" framespacing="0">
      <frame name="footer" src="footer.html">
      <frame name="footer2" src="footer2.html">
      <frame name="sound" src="sound.html" target="_self">
    </frameset>

  • How can I install a version of Safari compatible with MacOS 7.5

    At some point I downloaded and installed Safari 6.0.2 on a MacBook Pro (4.1) running OS 10.7.4. When I tried to open it, an error message appeared stating that this version of Safari is incompatible with OS 10.7.x and is compatible with OS 10.8. Since then I updated to OS 10.7.5. After completing the update the iCloud System Preferences automatically opened. Next to the Bookmarks Icon was a button saying "Install Safari." Pushing this button brings me to a webpage that appears to be advertising copy for Safari but seems to lack any option for downloading Safari. Searching for an OS 10.7.5 compatible version I came across a page with quite a number of Safari downloads at Apple - Support - Downloads. This page offers dowloads of Saafari for earlier versions of Safari, but not for an OS 10.7.x compatible version of Safari. What is the solution? If I upgraded to OS 10.8 or OS 10.9 would I gain access to Safari once again? I'd be most appreciative of any help with this issue. Thanks.
    MacBook Pro (early 2008)
    2.5 GHz Intel Core 2 Duo
    4GB RAM
    MacOS  10.7.5 (11G63)

    Thanks Z-B-B for your quick response. I downloaded and installed the version of Safari (6.1.4) that is described as compatible with OS 10.7.5.on the website you suggested. I restarted the computer. After it restarted Safari had regained its proper icon. However, when I tried to open Safari, it immediately crashed with the following error message:
    Process:         Safari [2169]
    Path:            /Applications/Safari.app/Contents/MacOS/Safari
    Identifier:      com.apple.Safari
    Version:         6.1.4 (7537.76.4)
    Build Info:      WebBrowser-7537076004000000~1
    Code Type:       X86-64 (Native)
    Parent Process:  launchd [173]
    Date/Time:       2014-06-29 13:41:25.304 -0400
    OS Version:      Mac OS X 10.7.5 (11G63)
    Report Version:  9
    Interval Since Last Report:          9870 sec
    Crashes Since Last Report:           6
    Per-App Crashes Since Last Report:   5
    Anonymous UUID:                      F6978949-EFAB-4C2E-B3C8-F07470E4B945
    Crashed Thread:  0
    Exception Type:  EXC_BREAKPOINT (SIGTRAP)
    Exception Codes: 0x0000000000000002, 0x0000000000000000
    Application Specific Information:
    dyld: launch, loading dependent libraries
    Dyld Error Message:
      Library not loaded: /System/Library/Frameworks/Accounts.framework/Versions/A/Accounts
      Referenced from: /System/Library/StagedFrameworks/Safari/Safari.framework/Safari
      Reason: image not found
    Binary Images:
           0x101912000 -        0x101912fff  com.apple.Safari (6.1.4 - 7537.76.4) <BA8D8641-9DA7-3A2E-BC08-93DBC574A5DC> /Applications/Safari.app/Contents/MacOS/Safari
           0x10191e000 -        0x101e13fff  com.apple.Safari.framework (8536 - 8536.26.17) <A28655B2-8394-32D4-82C2-725FAD855E48> /System/Library/StagedFrameworks/Safari/Safari.framework/Safari
        0x7fff61512000 -     0x7fff61546baf  dyld (195.6 - ???) <C58DAD8A-4B00-3676-8637-93D6FDE73147> /usr/lib/dyld
        0x7fff88980000 -     0x7fff889adfe7  libSystem.B.dylib (159.1.0 - compatibility 1.0.0) <6E5C8AC3-DBB7-31CB-BEB7-D6ED8E6DE0CE> /usr/lib/libSystem.B.dylib
    Model: MacBookPro4,1, BootROM MBP41.00C1.B03, 2 processors, Intel Core 2 Duo, 2.5 GHz, 4 GB, SMC 1.27f3
    Graphics: NVIDIA GeForce 8600M GT, GeForce 8600M GT, PCIe, 512 MB
    Memory Module: BANK 0/DIMM0, 2 GB, DDR2 SDRAM, 667 MHz, 0x7F7F7F7F7FF70000, 0x00004B363435365536314535363637460000
    Memory Module: BANK 1/DIMM1, 2 GB, DDR2 SDRAM, 667 MHz, 0x7F7F7F7F7FF70000, 0x00004B363435365536314535363637460000
    AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x8C), Broadcom BCM43xx 1.0 (5.10.131.36.15)
    Bluetooth: Version 4.0.8f17, 2 service, 18 devices, 1 incoming serial ports
    Network Service: AirPort, AirPort, en1
    Serial ATA Device: Hitachi HTS542525K9SA00, 250.06 GB
    Parallel ATA Device: HL-DT-ST DVDRW  GSA-S10N
    USB Device: Built-in iSight, apple_vendor_id, 0x8502, 0xfd400000 / 3
    USB Device: USB 2.0 Hub, 0x1a40  (TERMINUS TECHNOLOGY INC.), 0x0101, 0xfd100000 / 2
    USB Device: Cruzer, 0x0781  (SanDisk Corporation), 0x5530, 0xfd140000 / 4
    USB Device: BRCM2046 Hub, 0x0a5c  (Broadcom Corp.), 0x4500, 0x1a100000 / 2
    USB Device: Bluetooth USB Host Controller, apple_vendor_id, 0x820f, 0x1a110000 / 4
    USB Device: Apple Internal Keyboard / Trackpad, apple_vendor_id, 0x0230, 0x5d200000 / 3
    USB Device: IR Receiver, apple_vendor_id, 0x8242, 0x5d100000 / 2

  • How to verify JavaScript alert message display on page with C#?

    Hi All,
    I have a question about verify the JavaScript alert message on page. For example, I input the script in browser address like: "javascript:onmouseover=alert('popup windows')" . How to verify there's a alert message displayed on page with C#?
    Thanks

    Are you trying to use some automation or ? What the previous solution is they have put the text in the dom for you to pull out with C# or other languages.
    if you are trying to automate this through a browser maybe look into WebDriver
    WebDriverWait wait = new WebDriverWait(driver, 2);
    wait.until(ExpectedConditions.alertIsPresent());
    Alert alert = driver.switchTo().alert(); var alertText = alert.Text;
    alert.accept();

  • How to give link to concrent/request seeded page with breadcrumb from apex

    Hi,
    I have given link to Concurrent request seeded page From apex for view the details of conc/req when it is submitted from Apex button. The conc/req page is opening. But I need breadcrumb to be given into the conc/req details page to go back to my Apex page. I dont know how to give this link.
    I tried with OAWebBeanConstantes=ADD_BREADCRUMB_YES and also I tried with addBreadcrumb=Y with the URL of apps conc/req details page(MONITOR Page).
    Please someone help me ,How can I give breadcrumb to the apps page to move back to Apex once details are seen.
    Thanks
    Alaka

    Hi All,
    Please someone tell me how to resolve this...?? I have already tried with the breadcrumb as I mentioned above. But from OAF to concurrent request details (Requests) page breadcrumb feature is supporting. From Apex to that page why it is not supporting. Is there any other way to do this.?
    Thanks
    Alaka

  • How can I Reconcile all tables on multiples mappings with scripting????

    I have OWB 9.2.0.2.8
    I have to reconcile all tables and external tables on multiple mappings.
    How can I do it with scripting language, please?
    Thanks very much in advance!!!!

    Good afternoon Claudio,
    Should be something like this:
    foreach mapName [OMBLIST MAPPINGS] {
      puts "Checking $mapName"
      foreach tabName [OMBRETRIEVE MAPPING '$mapName' GET TABLE OPERATORS] {
        puts "Reconciling $tabName"
        OMBRECONCILE TABLE '$tabName' \
          TO MAPPING '$mapName' \
          OPERATOR '$tabName' \
          USE (RECONCILE_STRATEGY 'REPLACE', MATCHING_STRATEGY 'MATCH_BY_OBJECT_ID');
    }If you want to alter reconcile and/or matching strategy, check documentation on OMBRECONCILE in the OWB Scripting Reference.
    Good luck, Patrick

Maybe you are looking for

  • I give up. I still can't open iTunes.

    This is the FOURTH time I'm posting this.... people seem to read my quesiton, but no one has any answers for me. When trying to open iTunes, a dialog box opens up with the caption "iTunes Setup Assistant", and header line "Download Album Artwork" whi

  • Business area wise tax reports

    Dear Sapgurus, When i purchase of goods give the tax code after it will calculated tax automatically anf it will posted also bu i need the tax percentage based on businessare wise how do i get, when i post tax automatically business area is not popul

  • Deleting QM View in the material master

    Hi Is their any way we can delete the QM view in the  material master , once it is created Thanks JJ

  • Comment retrouver l'utilisation d'une variable partagée dans un projet

    J'ai un projet assez important où j'utilise des variiableables partagées. Le problème arrive lorsque je veux les retrouver. Avec un vi ou une variable glogale, c'est facile : il suffit de faire un clic droit et de sélectionner "trouver toutes les ins

  • TS3694 how to over come from this error

    i can not able to start my i phone after i update my phone