I need to write a Java script to make my Art board bigger by 1 (one) inch on the Width and Length, Regardless of the Content?

Hi,
I am currently using "Visible bounds" (java script)to add 1 inch to the width and to the Length of my Art board, but when i make a clipping mask it actually reads the hidden content from the Clipping mask and makes conforms my art board to that particular shape. Am using Adobe illustrator cs6 Here is My Code:
var myDocs = app.documents;
var i = 0;
for (i = myDocs.length-1 ; i >= 0; i--)
    var doc = myDocs[i];
    app.activeDocument= doc;
    var myVisibleBounds = doc.visibleBounds; //Rect, which is an array;
    myVisibleBounds[0] -= 36;
    myVisibleBounds[1] += 36;
    myVisibleBounds[2] += 36;
    myVisibleBounds[3] -= 36;
    doc.artboards[0].artboardRect = myVisibleBounds;
All i Want is to add 1 inch to my width and length and this does it but if i have a clipping mask it will pick up the bounding box i guess? and it will conform it to the shape... any help please... Try my code and you will see that it does add 1 inch but now make you artboard lest say 12" x 12" and make a shape bigger than the art board and you will see how it adds 1 inch to the art board based on that shape...  now if you make a clipping mask to fit that shape in the 12" x 12" art board you will still get 1 inch bigger than the shape thats being clipped ... 

yes, visible bounds is reading the non-visible masked objects too.
you're going to have to do it the hard way, loop through all your objects to get your bounds manually, and while you're at it, test for clipping masks and use the masking path instead.

Similar Messages

  • I need to insert some Java script in my muse page. What is the best way to do that?

    I have a site I've built in Muse. I need to add a video (and not via youtube) to my  Muse site as well as some Java script. I'm not sure how to do that. I have some Java script to make appointments and scheduling but can't add it to that Muse page. Any thoughts? Thanks

    1. right click on your page
    2. choose page properties
    3. choose metadata
    4. add javascript in head section
    <script type="text/javascript">
    </script>
    or choose object and then insert html
    you can right click that object and choose edit html and (re)write code.

  • Help needed for Time Calc Java Script

    Hi,
    I am trying to create a timesheet in PDF and have hit a speed bump. Is there anyone there who could provide me with a script that calculated the difference between 2 times? (Field2 time)-(Feild 1 Time) = Duration.I am desperate and have tried everything.
    I proccess the payroll for a company and all of the 500 or so timesheets that I received each fortnight are paper copies and I am pulling my hair out. I need to use Adobe forms (We have Adobe Pro 9 and I am using the XML forms, not live cycle) as the serach engine that we use for emails cannot search on excel documents.
    I have no Java script experience and I am getting completely lost in the subject. Any help would be greatly appreciated.
    Thanks anyone who can help at all.
    -Sohnia

    hi friend here example for time calulation start and end time example..<br />just copy and paste then run it ur browser.<br /><br /><HTML><br /><script language="JavaScript"><br /><!--<br /><br />var h1 = 1;<br />var h2 = 2;<br />var days = 0;<br />var m1 = 1;<br />var m2 = 2;<br />var am1 = 1;<br />var am2 = 2;<br />function findtime(h1,h2,days,m1,m2,am1,am2)<br />{<br />var answer = "why";<br />var mdiff = 1;<br />var hdiff = 2;<br />pdays = parseInt(days);<br />ph1 = parseInt(h1);<br />ph2 = parseInt(h2);<br />pm1 = parseInt(m1);<br />pm2 = parseInt(m2);<br />if(am1 == 2 & ph1 < 12) ph1 = ph1 + 12;<br />if(am2 == 2 & ph2 < 12) ph2 = ph2 + 12;<br />if(am1 == 1 & ph1 == 12) ph1 = 24;<br />if(am2 == 1 & ph2 == 12) ph2 = 24;<br />if(am1 == 2 & am2 == 1 & ph2 < 24) ph2 = ph2 + 24;<br />if(am1 == am2 & ph1 > ph2) ph2 = ph2 + 24;<br />if(pm2 < pm1){<br />pm2 = pm2 + 60;<br />ph2 = ph2 - 1;<br />}<br />mdiff = pm2 - pm1;<br />hdiff = (ph2 - ph1) + (pdays * 24);<br />if(hdiff == 0) answer = mdiff + ' minutes';<br />else if(hdiff == 1) answer = '1 hour and ' + mdiff + ' minutes'<br />else answer = hdiff + ' hours and ' + mdiff + ' minutes'<br />return answer<br />}<br /><br />//--><br /></script><br /></HEAD><br /><br /><font face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular"><br /><BODY BGCOLOR=FFFFFF TEXT=000000 LINK=0000FF VLINK=800080><br /><br /><div align="center"><table width="950" border="0" cellpadding="0" bgcolor="#899194" cellspacing="0"><br /><br />  <br /><tr><td valign="middle" width="33%"><br /><br /><center><br /><form><br /><TD WIDTH=80%><br /><center><br /><TABLE ALIGN=MIDDLE BORDER=5 CELLPADDING=5><br /><TR BGCOLOR=#FFFFFF><br /><!--ROW 1--><br /><TD WIDTH=80%><br /><center><br /><TABLE ALIGN=MIDDLE BORDER=5 CELLPADDING=5><br /><TR BGCOLOR="#B6D4D2"><br /><!--ROW 1--><br /><td colspan=4><br /><center>Time Between Times Calculations - Multiple Days</center><br /><br /></td><br /></tr><br /><TR BGCOLOR="#B6D4D2"><br /><TD align="center" colspan=4><br />Required Data Entry<br /></td><br /></tr><br /><tr><br /><td align="center">Start / End</td><br /><td align="center">Hour</td><br /><td align="center">Minute</td><br /><td align="center">AM / PM</td><br /></tr><br /><br /><td align="center">Start time</td><br /><td align="center"><input type="text" name="hour1" size="5"></td><br /><td align="center"><input type="text" name="minute1" size="5"></td><br /><td align="center"><select name="period1"><br /><option value="1">AM<br /><option value="2">PM<br /></select><br /></td><br /></tr><br /><tr><br /><td colspan="3">    Add Complete Interim Days</td><td align="center"><input type="text" name="adays" size="5" value="0"></td><br /></tr><br /><tr><br /><td align="center">Start / End</td><br /><br /><td align="center">Hour</td><br /><td align="center">Minute</td><br /><td align="center">AM / PM</td><br /></tr><br /><td align="center">End time</td><br /><td align="center"><input type="text" name="hour2" size="5"></td><br /><td align="center"><input type="text" name="minute2" size="5"></td><br /><td align="center"><select name="period2"><br /><option value="1">AM<br /><option value="2">PM<br /></select><br /></td><br /></tr><br /><br /><tr><br /><td align="center" colspan=4 BGCOLOR="#B6D4D2"><br /><input type="button" value="Calculate" <br />onclick="h1=form.hour1.value;<br />h2=form.hour2.value;<br />m1=form.minute1.value;<br />m2=form.minute2.value;<br />days=form.adays.value;<br />am1=form.period1.options[period1.selectedIndex].value;<br />am2=form.period2.options[period2.selectedIndex].value;<br />if(h1 < 0 | h1 > 12) alert('Your start hour is not valid');<br />else if(h2 < 0 | h2 > 12) alert('Your end hour is not valid');<br />else if(m1 < 0 | m1 > 59) alert('Your start minute is not valid');<br />else if(m2 < 0 | m2 > 59) alert('Your end minute is not valid');<br />else form.answer.value=findtime(h1,h2,days,m1,m2,am1,am2);"><br />   <br /><input type="reset" value="Clear Values"><br /><br /></td><br /></tr><br /><TR BGCOLOR="#B6D4D2"><br /><TD align="center" colspan=4><br />Calculated Results<br /></td><br /></tr><br /><br /><tr><br /><td align="center" colspan="4"><br />Time Difference <input type="text" name="answer" size="40"><br /><tr><td>[email protected]</td></tr><br /></td><br /></tr><br /></table><br /></form><br /></td><br /></tr><br /></table><br /><br /></center><br /></td><br /></tr><br /></table><br /></center><br /><br /></TD><br /></TR><br /></TABLE><br /></BODY> <br /></HTML>

  • Need Kick start for Java Script

    Hi I am working on WAD, I need to learn Java script as early as possible. I am trying from all my sides. can u suggest me so that i can learn Java Script.

    Hi,
    http://www.w3schools.com/js/default.asp is a veruy good start.
    Others are:
    http://www.echoecho.com/javascript.htm
    http://www.wdvl.com/Authoring/JavaScript/Tutorial/
    Eddy
    PS.
    Did you put yourself on the SDN world map already? Pls check
    /people/eddy.declercq/blog/2006/06/14/from-the-grumpy-old-man-hoy-en-el-mundo
    for details.

  • I had to upgrade from ios7 to ios8 but it needed more storage than i had so i backed up my phone to my computer then deleted the content on my phone and upgraded to ios8.  i have not connect my phone and computer since.  how do i get my content back?

    i had to upgrade from ios7 to ios8 but it needed more storage  i had so i backed up my phone to my computer then deleted the content on my phone and upgraded to ios8.  i have not connect my phone and computer since.  how do i get my content back? 

    Restore the backup from your computer

  • I need someone to write a Java Script for my Adobe Acrobat form. I do not know how to write Java Code

    I have never worked with Java coding and am in need of assistance for an acrobat form I am working on.
         - I have a form with a field identifier called BACompnayName (this is the field where they would enter their company name).
         - I then have a form field with two radials that says "Is the shipping address the same as the business Address" - "Yes" and "No" (the form identified for this field is SASame.
    What I am trying to accomplish:
         - If they click yes, I would like the form to fill in the information found in BACompanyName otherwise, leave it blank to be filled out by the person filling out the form.
    I appreciate any help.
    Thanks,
    Brett

    Something like the following?
    Checkbox for &quot;make billing address the same as shipping address&quot; doesn't work (JavaScript)

  • Need to write a startup script for TunTap

    Dear community,
    I am using 10.10.1, 13" MBPr Late 2013 and I need to be able to access my Work VPN. From what i have been told, the OS X client can't work and that I have been advised to use Shrew Soft VPN. (We initially tried to get the WatchGuard Firewall to build a Mac .dmg and that didn't work). To get ShrewSoft to work, I have had to follow these steps:
    http://ulaptech.blogspot.co.uk/2012/11/shrew-soft-vpn-client-for-mac-os-x.html
    ·         Install the qt-mac-opensource-4.7.1.dmg file first
    ·         Install the tuntap20111101.tar.gz file second
    ·         Install the shrew soft client.
    But the TunTap download that is above will not work as it is unsigned and Yosemite has now killed off unsigned kexts.I tried turning off the requirement for OS X for signed kexts by using this command:
    sudo nvram boot-args="kext-dev-mode=1"
    Then rebooting, but it didnt work.
    I can get the VPN to work if I open up terminal and enter these two commands:
    sudo kextload /library/extensions/tap.kext
    sudo kextload /library/extensions/tun.kext
    But I have to do this everytime i turn my Mac on.
    Could somebody please help me write those two lines into a startup script? As I really have no idea how to do it.
    Your help and guidance would be appreciated

    Choose Utilities from the Finder’s Go menu, open the AppleScript Editor, and paste in the following:
    set thepassword to text returned of (display dialog "Your administrator password is required." default answer "" with hidden answer)
    do shell script "kextload /Library/Extensions/tap.kext" with administrator privileges password thepassword
    do shell script "kextload /Library/Extensions/tun.kext" with administrator privileges password thepassword
    Save it as an application and set it as a login item.
    (120186)

  • How can I hide what I write in Java Script

    If I write a script, I offer it to many one to use it, but I don’t want to anyone to see what I write in the script, how can I do?

    In ESTK go to "File" and select "Export as Binary..."
    HTH
    Marijan (tomaxxi)
    http://tomaxxi.com

  • I've upgraded my iPad 2 to iOS 6, and now I can't download apps! What's the matter? When I try to install, it starts, and then I need to write in 3 secret questions to protect my Apple-ID. But then it doesn't work and the app quits downloading. Why?

    ⬆It says it all up there⬆

    1) Quit App Store in multi-tasking.
    •From the Home screen, click the Home button twice.
    •Tap and hold on the app.
    •When it starts to jiggle, tap the red in the top corner to close it;
    ***Please close all open apps on your phone***
    2) Tap Settings.
    3) Tap Safari.
    4) Tap Clear History.
    5) Tap the Clear History button.
    6) Tap Clear Cookies and Data.
    7) Tap the Clear Cookies and Data button

  • My iCloud address on the iPad needs to be changed. If I press "delete account" it tells me I will lose all the content including pictures. How can I change it? I see other people have had the same problem

    I have had to change my e mail address but I cannot work out how to amend it on my iCloud account. If I press "delete account" the box appears telling me that I will lose all content including photos if I continue. The box asking for a password keeps appearing but I just press cancel and continue.
    I have not attempted to upgrade to iOS 7 until this problem is sorted. Can anyone help please?

    If you mean that you created a new icloud account using a new email address as the primary address, then when changing to that account on a device, all data maintained by the old account will be deleted.  I was not aware that photos are included.  But as for photos, ALWAYS sync them to a computer for archiving, never rely on icloud as your only backup.
    If you want to keep the contacts, etc. data from the old account, then go to Settings>icloud and turn off the services, one at a time.  When doing so, you are given the choice to keep the data local or delete from the device.  Later, when doing Delete Account and logging into the new account, your data will sync up to it.
    If, on the other hand, your changed email address is just an alias in the existig icloud account, then there's no reason to delete the account as the alias is just another link to the same account.

  • I need to set my frames to 4:3, what are the width and length measurements? I think its 740x920 but I'm not sure.

    What are the measurements for 4:3?? I think its 720x940 but I'm not sure.

    "Standard definition has always been a 4:3 aspect ratio with a pixel resolution of 640 × 480 pixels. Mini-DV, DVCAM, DV footage is recorded at 29.97 frames per second in this standard definition as seen on DV tapes"

  • Using Java Script in Adobe Acrobat

    I am attempting to create input forms using Adobe Acrobat. I've got the form created, and most of the functionality works. The only issue I'm having is that my end users need to be able to fill out the form, click the Submit button, and the form data needs to be sent to an e-mail address for processing. I don't need the form to be saved and sent as a PDF attachment, I just need the form data to be submitted as the BODY of an e-mail. I was told I needed to write a Java Script for this, but I don't know the first thing about that. Can anyone help me out with a Javascript they already use? I've got a week to make these forms work.

    Most web hosting services will have a mailform type script installed and available for use. If you're running your own web server, such scripts are freely available. The form just needs to be configured correctly to work with the server script. When the form is submitted to the web server, the server-side mailform script reads the incoming data and generates an email that includes the name/value pairs in the body of the email. There are literally thousands of such scripts available, to you'd have to refer to their documentation for information on setting up the form to submit to the script you want to use.
    No scripting is necessary in the form in order to submit to the web server, thought the submitForm method can be used and offers a bit more flexibility. For example, you can use a script to check the form for completeness/correctness before submitting and abort if something is wrong.
    A major advantage of submitting to a web server is it is generally far more reliable than the alternative of relying on the user's system to send the email. It can also be secured relatively easily with HTTPS/SSL, though that just covers the form submission and not when the server sends the email.

  • JAVA-scripts freezes and need to be force closed

    I'm running Firefox 20.0.1 on Win7 x64 and all of a sudden, all JAVA-scripts freezes and i can do nothing but wait. After about 30sec i get a message saying that...
    'A script on this page may be busy or have stopped responding. You can stop the script now or wait for the script to complete' (or similar).
    I get the message in Swedish so it's roughly translated. I included some screenshots of the error (all from different pages).
    [IMG]http://i41.tinypic.com/wscxu.png[/IMG]
    It works fine in safe mode and when i disable JAVA. I can't think of anything more right now, and i actually need to write this message using Chrome because i can't get here using Firefox anylonger.
    It sucks and really need your help. Thanks!

    ry a clean reinstall and delete the Firefox program folder before (re)installing a fresh copy of the current Firefox release.
    Download a fresh Firefox copy and save the file to the desktop.
    *Firefox 20.0.x: http://www.mozilla.org/en-US/firefox/all.html
    Uninstall your current Firefox version, if possible, to cleanup the Windows registry and settings in security software.
    *Do NOT remove personal data when you uninstall your current Firefox version, because all profile folders will be removed and you will lose all personal data like bookmarks and passwords from profiles of other Firefox versions.
    Remove the Firefox program folder before installing that newly downloaded copy of the Firefox installer.
    *(32 bit Windows) "C:\Program Files\Mozilla Firefox\"
    *(64 bit Windows) "C:\Program Files (x86)\Mozilla Firefox\"
    *It is important to delete the Firefox program folder to remove all the files and make sure that there are no problems with files that were leftover after uninstalling.
    *http://kb.mozillazine.org/Uninstalling_Firefox
    Your bookmarks and other personal data are stored in the Firefox profile folder and won't be affected by an uninstall and (re)install, but make sure that "remove personal data" is NOT selected when you uninstall Firefox.
    If you keep having problems then also create a new profile.
    *http://kb.mozillazine.org/Profile_folder_-_Firefox
    *http://kb.mozillazine.org/Profile_backup
    *http://kb.mozillazine.org/Standard_diagnostic_-_Firefox#Clean_reinstall

  • I need help writing an if then statement Java Script.

    In the Text Field Properties box I see the Calculate tab where I think that the form can do a logic (IF/THEN) function if I can place the correct Java Script code into the form. Unfortunately; I do not know how to write in Java Script.
         - I have a form with a field identifier called BACompnayAddress (this is the field where they would enter their address).
         - I then have a form field with two radials that says "Is the shipping address the same as the business Address" - "Yes" and "No" (the form identified for the radials is SASame.
    What I am trying to accomplish:
         - If they click Yes, I would like the Shipping Address field (field identifiier ShippingAddressAddress) to fill in the information found in BACompanyAddress and if they click No leave the  field blank to be filled out by the person filling out the form.
    I appreciate any help.
    Thanks,
    Brett

    If that's what it does, that is exactly what you said it needs to do. You said niothing about what should cause it to go back to frame 1.  If you want it to go back to frame 1 with a ROLL_OUT event, then you would add a listener for that. If you want something else to trigger it to go back, then you just need to work that out.
    The only time I can see where an if/else would be needed is if you want it to change frames for every rollover such that if it is in frame 1, then go to frame 2, and vice versa the next time you rollover it.

  • Need help with Java Script to perform a calculation in Adobe Acrobat Pro 9 form

    I have a form (test) that I am creating in Adobe Acrobat Pro 9.
    I need help creating custom Java Script so I can get the desired answer.
    1) There are several questions in each group that require a numerical answer between 0-4
    2) There is a total field set up to sum the answers from all above questions
    3) The final "score" takes the answer from Step 2 above and divides by the total possible answer
    Any help on what Java Script I need to complete this would be greatly appreciated!
    I've attached a "spreadsheet" that shows it in more detail as well as what formulas I used in Excel to get the desired end result.
    Thanks in advance.

    Have you tried the "The field is the average of:"?

Maybe you are looking for