{Carrer web log}
Draw Shapes in Photoshop with JavaScript
Monday, October 24, 2011 { 4 Comments }
I was working on the Photoshop Wireframing Kit update and I wanted to optimize the drawing of some photoshop vector shapes. Few designers know that JavaScript, VBS and AppleScript can be used to optimize the Photoshop workflow. The cool thing about JavaScript in Photoshop is that will run on both PC and MAC.I was googling and searching for solution for my scripting problem when I stumbled upon this forum post (look for Mike Hale answer) http://www.ps-scripts.com/bb/viewtopic.php?f=14&t=1802&start=15 . I did some small changes in the code - making it function that will accept multiple parameters (coordinates). All the credits for this code goes to Mike Hale he is the author of the code.
What this script does?
Basically what this script does is draws pixel precise shapes in Photoshop with the help of JavaScript.
You need to put Photoshop coordinates in clockwise order and Photoshop will draw the shape.
Example of Square:
// [X,Y], [X,Y] coordinates in clockwise order
DrawShape([100, 100], [100, 200], [200, 200], [200, 100]); // Square
DrawShape([512, 128], [600, 256], [684, 320], [600, 386], [686, 514], [512, 450],[340,512],[428,386],[340,320],[428,256]); // Star
Result in Photoshop:
You can also set the background color inside the script.
The script:
Gist on GitHub
Direct Download
For installing this script you need to download DrawShape.js script copy the script inside Photoshop > Presets > Scripts - Folder
For running this script you need to go to open Photoshop and than File > Scripts > Browse find the script (where you previously copied it) and click Open.
Change the coordinates inside DrawShape(); to personalize the script.
I only did some tests in Photoshop CS5 but should probably run in some previous versions.
Any comments?
Initiative - provide JSON and JSONP RSS Feeds
Monday, October 10, 2011 { 6 Comments }
JSON has won against XML. Because is lighter and simpler.Many web services are giving priority to JSON over XML. But the all the blogs are still stuck with XML RSS.
So why give JSON and JSONP RSS support?
- JSON is Fat-Free Alternative to XML (save some bandwidth).
- JSON has been chosen like primary format in almost all major public web services.
- JSONP is easiest and fastest way to directly connect the browser with the web service.
- Growing need of building native web apps who can connect directly with the data source.
.. and probably many other reasons.
This initiative comes from my personal frustration … every time I want to build some web app who needs to talk with RSS and JavaScript I need to use some public proxy like YQL or some other server side XML to JSON solution. JavaScript and the browsers had grown much in the last couple of years, we could start using the browser JavaScript engine speed for some heavy lifting. Implementing JSON and JSONP like an alternative to XML(RSS) is very easy process.
I think if some of the major blog players like Blogger, Tumblr, WordPress, Posterous provide JSON RSS support everyone else will follow.
That doesn't mean that we should kill XML RSS it means just providing alternative JSON support.
If you agree with me help me spread the word. Thanks!
About Me <<<
Name: Vladimir Carrer
vladocar [at] gmail.com
Location: Verona, Italy
I'm a web designer, developer, teacher, speaker, generally web addicted ...
My projects <<<
- AI Prompt Directory
- Hand Drawn Icons
- Font Design Inspiration
- Font Pairings
- Free SVG Cut File
- Upcoming NFT projects
- Discord Tutorials
- Free Sublimation Designs
- Tech Feed
- MySQL Lite Administrator
- Quark Mini PHP CMS
- Formy - CSS Form Framework
- Emastic - CSS Framework
- Malo - CSS Library
- The Golden Grid
- 1 line CSS Grid Framework
- Two Lines CSS Framework
- Child Selector System - CSS Framework
- Better Web Readability Project
- Azbuka - CSS Typographical Base Rendering Library
- ClipR - bookmarklet for better reading
- CSS3 Action Framework
- CSS Mini Reset
- HTML5 Mini Template
- CSS Mobile Reset
- picoCSS - JavaScript Framework
- HTML Lorem Ipsum Crash Test
- Object Auto Documentation - JavaScript
- o - JS Library for Object Manipulation
- Foxy - CSS Framework
- Tumblr Free Theme - Better Readability Project
- Box - CSS Framework
- SMART CSS GRID
- nanoJS - Minimal JS DOM Library
- Flexy CSS Framework
- Katana is CSS Layout System made with Flexbox
- Micro CSS Reset
- 60 Grid System
- Simple CSS Button
- ramd.js JavaScript library for making web applications.
- Minimal Notes web app build with Vue.js
- Scribble Font for Prototyping & Wireframing
- Flex One - 1 CSS Class System
- Floaty - CSS Float Based Layout System
- Infinity CSS Grid
- CLI Convert websites into readable PDFs
- keywords-extract - CLI tool, extract keywords from any web page.
- screenshoteer - Make website screenshots and mobile emulations from the command line.
- Basic.css - Classless CSS Starter File
§§Previous Posts <<<
- GPT-3 and CSS Frameworks
- Don’t use CSS Reset use CSS Set
- One Page 2020 Calendar Print Version
- 3 CLI tools based on Node.js
- Scribble Font for Prototyping & Wireframing
- ramd.js - Small JavaScript library for making TODO...
- Katana.scss - CSS Layout System made with Flexbox
- Flexy CSS Framework
- nanoJS - JavaScript for DOM manipulation
- SMART CSS GRID
§Archives <<<
- May 2006
- June 2006
- July 2006
- August 2006
- September 2006
- October 2006
- January 2007
- February 2007
- October 2007
- April 2008
- June 2008
- July 2008
- August 2008
- September 2008
- November 2008
- December 2008
- January 2009
- February 2009
- March 2009
- April 2009
- May 2009
- June 2009
- August 2009
- September 2009
- October 2009
- November 2009
- December 2009
- January 2010
- February 2010
- March 2010
- April 2010
- May 2010
- June 2010
- July 2010
- August 2010
- September 2010
- October 2010
- November 2010
- December 2010
- January 2011
- February 2011
- March 2011
- April 2011
- May 2011
- June 2011
- July 2011
- August 2011
- September 2011
- October 2011
- November 2011
- December 2011
- January 2012
- February 2012
- March 2012
- April 2012
- June 2012
- August 2012
- November 2012
- January 2013
- March 2013
- June 2013
- October 2013
- November 2013
- March 2014
- September 2014
- October 2014
- November 2015
- March 2018
- May 2018
- June 2018
- July 2018
- October 2018
- January 2019
- January 2020
- June 2020
- April 2021
Other Profiles <<<
Content is licensed under a Creative Commons Public Domain License