Basic Scripting: draw a square and add the line color
Hello:
I want to draw 2 concentric squares in a new layer:
First square is orange (no) - 10 points lower than the size of the page
2nd square is blue (no) - 10 points smaller than the first square
Thank you
Maria
Please try this...
#target photoshop
main() {} function
if(!documents.) Length) return;
var startRulerUnits = preferences.rulerUnits;
preferences.rulerUnits = Units.PIXELS;
app.displayDialogs = DialogModes.NO;
var FillColour = new SolidColor;
FillColour.rgb.hexValue = "fba200"; Orange
var ad = activeDocument;
var w = ad.width.value;
var h = ad.height.value;
tempLayer var = ad.artLayers.add ();
ad. Selection.Select ([[10.10], [w - 10, 10], [w - 10, h-10], [10, h-10]], SelectionType.REPLACE, 0, false);
ad. Selection.Stroke(FillColour,1);
ad. Selection.Deselect)
FillColour.rgb.hexValue = "0000ff"; Blue
ad. Selection.Select ([[20,20], [w - 20, 20], [w - 20, h-20], [20, h-20]], SelectionType.REPLACE, 0, false);
ad. Selection.Stroke(FillColour,1);
ad. Selection.Deselect)
app.preferences.rulerUnits = startRulerUnits;
}
main();
Tags: Photoshop
Similar Questions
-
Hi, I'm new (very) to Illustrator so please go easy. I'm in a bit of a pickle and would very much help to get out!
I created an illustration using the pen tool, making a series of paths open and closed (below), all stroked them in the color purple. I then used the Shapebuilder Ranger a few areas of intersection.
Later, I started using live paint to color block the form contained in the paths, however, when I try to change the outline of these 'forms' that won't happen.
I tried releasing the images of live paint and changing the line color of the sketch (i.e. opening and closing original tracks), but this does not work either.
Any advice?
Thanks in advance,
Will be
Inside a live paint group you must activate the coloring of the traits.
To do this, double-click the live paint tool.
When you expand a live paint group, fills and strokes is separated. You get a group that has all the traits and another which has fillings.
You will need to inspect it in the layers panel, and then select the Group of traits in order to change.
-
How can I add a new parent account on behalf of the child on our Xbox. The original parent account no longer works. And we have not been able to recover the account. Is it possible I can make a new patent account and add the account of the child as a member of the family?
Scroll down to the bottom of the page, and then select an Option to contact Xbox Support
-
I have a Toshiba laptop (2 years) and had been printing wireless until about 2 months ago. Now, I have to delete and add the printer brother 7820-N USB to print for a day or less. When I try to againg another day it does not print.
Hello
Your question does contain all of the required information. Please provide us with the following information.
1. have you recently updated anything on your computer before this problem?
2 have you installed updates for the printer? If so, you may want to make back the driver and check if that helps.
3. you delete and add the printer, of in the software?
I suggest you follow the methods below to solve the problem:
Method 1:
Put the computer in a clean boot state and check if the problem still persists. Refer to the city link below to put the computer in a clean boot:
http://support.Microsoft.com/kb/929135/en-GB
Method 2:
I suggest you uninstall the printer completely from the computer software, restart the computer, and then try to install the latest version of the printer software, from the link below:
http://www.brother-USA.com/support/default.aspx?PgId=5&R3ModelID=MFC7820N
Kind regards
GauravPrakash - Microsoft Support
Visit our Microsoft answers feedback Forum and let us know what you think. -
How to connect to an Adobe Javascript(Folder Level Script) SAP Web Service and retrieve the response in a table of the Adobe Javascript/AcroJS. Could you please it explain with an example. I have two required input parameters that must be filled.
I s generic SOAP example/tutorial on my blog: get a serial number in a form using SOAP - KHKonsulting LLC
The web service uses only a single parameter, but you should be able to adapt the code to two arguments without problems.
-
I have purchased Adobe Design Standard CS6 2013 with serial number, but can't find the to no download on a new mac laptop. When I try and add the serial number to 24 digits on my account it doesn't seem to work?
CS6 - http://helpx.adobe.com/x-productkb/policy-pricing/cs6-product-downloads.html
You can also download the demo version of the software through the page linked below and then use your current serial number to activate it.
Don't forget to follow the steps described in the Note: very important Instructions in the section on the pages of this site download and have cookies turned on in your browser, otherwise the download will not work correctly.
CS6: http://prodesigntools.com/adobe-cs6-direct-download-links.html
-
During the whole until I chose the trial/subscription instead of the serial number, how do I go back and add the serial number?
Open acrobat > click Help > activate.
If you don't see this option, but rather see help > connect, uninstall that acrobat, clean (Download Adobe Reader and Acrobat tool - Adobe Labs) and then install the version without a subscription.
-
I want to add my own library fonts (less manage fonts) how to convert InDesign and add the necessary css?
You must ensure that your font licenses extend to the internet. Many do not.
If you are sure that you can use your fonts on the web, use font squirrel to create a kit.
Nancy O.
-
problem with tabs and filter the lines of memory cache
Dear all I have a problem with the oaf page has two tabs under two of them consists of a table and add the button to the row. Second tab, it's a detail of the first tab, which means that each line in the first tab may refer to one or more lines in the second tab, my problem is when I add the line in the first tab and go to the second tab to add lines to this line of the display of the page added all lines not only the matching lines.
my code:
1 - controller
When press Tab of Lot lines (partial action)
If (goLotsTab".equals (pageContext.getParameter (OAWebBeanConstants.EVENT_PARAM))) {" "}String trxLineId = "38";//row.getAttribute("TrxLineId").toString(); "
AddLotParam serializable [] = {trxLineId};
am.invokeMethod ("getTrxLot", addLotParam);
}
What press Add button lines of lots (partial action)
If (addLot".equals (pageContext.getParameter (OAWebBeanConstants.EVENT_PARAM))) {" "}
String trxLineId = "38"; row.getAttribute("TrxLineId").toString ();
AddLotParam serializable [] = {trxLineId};
am.invokeMethod ("addTrxLot", addLotParam);
}When press Add a tab line (partial action)
If (addLine".equals (pageContext.getParameter (OAWebBeanConstants.EVENT_PARAM))) {" "}
am.invokeMethod ("addLine", params);
}Methods 2 - am
public void getTrxLot (String pTrxLineId)
{
OAViewObject vo = (OAViewObject) getXXSiteLotsVO1 ();
LinVo OAViewObject = (OAViewObject) getXXSiteLineVO2 ();Line linRow = linVo.getFirstFilteredRow ("SelectLineFlag", "Y");
pTrxLineId = linRow.getAttribute("TrxLineId").toString ();If (!) VO.isPreparedForExecution ())
//{
try {}
String existringWhereClause = vo.getWhereClause ();
vo.setWhereClauseParams (null);
vo.setWhereClause("trx_line_id=:1");
vo.setWhereClauseParam (0, (pTrxLineId) Number);
vo.executeQuery ();
vo.setWhereClauseParams (null);
vo.setWhereClause (existringWhereClause);
}
catch (Exception exceptionl)
{
throw OAException.wrapperException (exceptionl);
}// }
following line is commented, but I think that it will contribute to the memory of the filter
cached data to be mapped.Rank [] lotRows = vo.getFilteredRows ("TrxLineId1", pTrxLineId);
}/////////////////////////////////////////////////////////////////
public void addTrxLot (String pTrxLineId)
{
OAViewObject vo = (OAViewObject) getXXSiteLotsVO1 ();
LinVo OAViewObject = (OAViewObject) getXXSiteLineVO2 ();Line linRow = linVo.getFirstFilteredRow ("SelectLineFlag", "Y");
pTrxLineId = linRow.getAttribute("TrxLineId").toString ();If (vo.getFetchedRowCount () == 0) {}
vo.setMaxFetchSize (0);
// }VO. Last();
VO. Next();
Line = vo.createRow ();
row.setAttribute ("TrxLineId", pTrxLineId);
vo.insertRow (row);
row.setNewRowState (Row.STATUS_INITIALIZED);
}OK, I'll share my latest code using other
public void createTransaction() {}
OAViewObjectImpl vo = getXXSiteHeaderVO1();
If (! vo.isPreparedForExecution ()) {}
vo.executeQuery ();
}
If (vo.getFetchedRowCount () == 0)
{
vo.setMaxFetchSize (0);
}
String status = "incomplete."
OADBTransaction txn = (OADBTransaction) getOADBTransaction ();
- oracle.jbo.domain.Date currentDate = txn.getCurrentUserDate ();
Line = vo.createRow ();
row.setAttribute ("TrxStatus", status);
- row.setAttribute ("TrxDate", currentDate);
vo.insertRow (row);
row.setNewRowState (Row.STATUS_INITIALIZED);
}
{} public void addLine (String pTrxHeeaderId)
OAViewObject vo = (OAViewObject) this.getXXSiteTrxVL1 () .getDestination ();
VO. Last();
VO. Next();
Line = vo.createRow ();
int linNum = vo.getFetchedRowCount () + 1;
row.setAttribute ("TrxHeaderId", pTrxHeeaderId);
row.setAttribute ("LineNum", String.valueOf (linNum));
row.setAttribute ("SelectLineFlag", "Y");
vo.insertRow (row);
row.setNewRowState (Row.STATUS_INITIALIZED);
}
Public Sub getTrxLot()
{
LinVo OAViewObject = (OAViewObject) this.getXXSiteTrxVL1 () .getDestination ();
Line linRow = linVo.getFirstFilteredRow ("SelectLineFlag", "Y");
String pTrxLineId = linRow.getAttribute("TrxLineId").toString ();
linVo.setCurrentRow (linRow);
OAViewObject vo = (OAViewObject) this.getXXSiteLineLotsVL1 () .getDestination ();
}
Public Sub addTrxLot()
{
LinVo OAViewObject = (OAViewObject) this.getXXSiteTrxVL1 () .getDestination ();
Line linRow = linVo.getFirstFilteredRow ("SelectLineFlag", "Y");
String pTrxLineId = linRow.getAttribute("TrxLineId").toString ();
linVo.setCurrentRow (linRow);
OAViewObject vo = (OAViewObject) this.getXXSiteLineLotsVL1 () .getDestination ();
VO. Last();
VO. Next();
Line = vo.createRow ();
row.setAttribute ("TrxLineId", pTrxLineId);
row.setAttribute ("RowKey", new oracle.jbo.domain.Number (1));
vo.insertRow (row);
row.setNewRowState (Row.STATUS_INITIALIZED);
}
-
Graphic style that adds the line without changing the filling?
I want to assign a graphic style that adds to the existing style. For example, I need to add the same line to various objects that have different fillings. I can do it with a graphic Style? I know that I can the group object and add the style of the group, but it complicates the structure of the file. I would have preferred the race has been added to the object itself. I watched "additives styles", but don't think they are what I'm looking for.
Thank you
Select the object of Alt/Option click on the graphic Style with the stroke to be added.
-
PANTONE + does not match the previous Pantone spot color chart. I have several customers who are using spot colors in logos etc and now these colors are a mess. Can I get and use the old color for Illustrator books?
Well, the spot color has not changed, but the way they were simulated four-color changed, they now use color management to get to the nearest ink possible task.
Here is some info:
-
Why have all my colors suddenly changed - from white to cream yellow and all the other colors in the same way?
This looks strangely like the good old 'false monitor via Windows Update profile'. If the selector of color shows the cream when it should be white, that's all.
We won't know until the OP comes back with more information and perhaps a screenshot, but in the meantime (since I'm away from my main system) I can try to locate my standard screenshot of one of the countless other threads I posted it that...
ah, it's here (last posted barely two weeks in Lightroom):
-
How can I activate the line color
I have the trial version of adobe creative elements, I'm doing a form with stoke colors only in the color of the title area. It will only allow me to change the gradient and not the bottom or contour. What should I do or is it because of the trial version
Select a text with a stroke style. Then go on the color and click the line, and the setting is displayed.
-
Lag when you draw a square by using the property plotimages.back on XY graph
Hello
I'm developing a simple program where you enter 2 vertical sliders on a XY chart by selecting coordinates X and then it should highlight in yellow the area between the two mentioned sliders.
The issue I'm having, is that even if the program is inspired by the square on the graph, there is a shift, which I can't get rid. I checked the input coordinates to draw the square and they seem correct, however, the gap is still there...
Please find attached my program, thank you very much for your help!
Well, I found the reason. To eliminate the offset, you must get the graph XY plot area limits and subtract 'top' and 'left' your coordinate of the cursor values
-
I need to find all of the XML elements and add a line break for the text of each of them
I need to find all XML elements and to add a line break the text of each of them.
Is it possible with a script?
Try this piece of code as it is. I hope that's what you want...
var myDoc = app.activeDocument; var inddRooElement = myDoc.xmlElements.item(0); var xPathElements = inddRooElement.evaluateXPathExpression("//*"); var elementCount = xPathElements.length; for(var eId=0; eId
----------------
Green4ever
Maybe you are looking for
-
How to disable the TouchPad 'tap to click' on Satellite A200 - 15L Vista
Until mid-December, I got the Synaptics Touchpad ' tap to click on "disabled. Then it became somehow activated, the context menu item to change to gray and the properties of the mouse, etc. settings contain no reference to it. It was suggested that u
-
HP19-2113w: how to stop audio playback in the background IE Toyota
Toyota ad runs in embarrassing background
-
OfficeJet Pro 8500 Premium a don't print from my laptop
I have an Officejet Pro 8500 a Premium. Juice I had charging ot my driver, thinking that he would resolve the question below, but it didn't. The connection string is portable-> docking station-> ethernet to the router-> ethernet for printer. On my l
-
Can I use the touchpad on my laptop to move the cursor and the buttons work for select. However I can't use the touch pad to tap. I know it works because I can use this feature when I connect, but of them on it does not type to select on any program.
-
Chips with 3 delimiter characters using regular expressions
Hello worldI have a function that is able to mark the input in a collection string using regular expressions.In case the input string is a character such as the comma or semicolon delimiter,We can just get the result we want like the example below. S