Coder Social home page Coder Social logo

mb-hilo / from-photoshop-to-flash Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hankpillow/from-photoshop-to-flash

0.0 2.0 0.0 120 KB

It's a small action to export Photoshop's layers and import it into Flash, placing all images in the same position.

JavaScript 100.00%

from-photoshop-to-flash's Introduction

About

This project was created to easily do the work of export images from your Photoshop's layout and import them into your Flash file keeping the layout's position properly.

Importing psd files using the 'Import' menu in Flash is not a big deal because the Photoshop doesn't allow You to choose the quality, and the by default is low quality.

These scripts doesn't have to work together but these fellows are really powerful when used in the recommended way.

First you choose in your psd file which layers you want to export than you run the PhotoshopExportLayers in the File/Scripts menu. It will export your list into a specific folder into the same level as your psd file are.

Then it's time to move to your flash file and run the FlashImportAndPlace in the Command/ menu and follow the dialog box.

To find out how it works and how to install it, see bellow:


PhotoshopExportLayers.jsx

Installation:

"Save file as a text file with a .jsx file name extension in the Presets/Scripts folder in your Adobe Photoshop CS4 directory."

documentation page 20.

Tip: Save your git rep wherever you want and just create an alias from the proper file and move it to the Adobe's structure.

How it works?

A folder with name {psd_path}/{psd_name}-layers/ will be created to place all exported images. If you have a psd called ~/tmp.psd, the exported folder will be like this: ~/tmp.psd-layers/

The script works in two modes:

  • (0) All visible layers - This mode will export every visible layer in your psd file, including groups and sub-groups;

  • (1) Only selected - You can select only one layer, but if you want to select more than one you have to put it into a layer group and select the group;

For both modes, another dialog box will be opened asking about the format (PNG24 or JPEG) and the quality (only for JPEG, png24 is always 100% quality).

Important:

- Clipping Mask will be ignored;
- Invisible layers will be ignored;
- Empty layers will be ignored;
- Layers with content fully out of stage will be ignored. 
- Layers with layer mask, vector mask or filter mask will be ignored.
- Basicaly this script should work with simple art layers, so before running the script fix your messy psd.

FlashImportAndPlace.jsfl

Installation:

Windows Vista
boot drive\Users\username\Local Settings\Application Data\Adobe\Flash CS4\language\Configuration\Commands

Windows XP
boot drive\Documents and Settings\user\Local Settings\Application Data\Adobe\Flash CS4\language\Configuration\Commands

Mac OS X
Macintosh HD/Users/userName/Library/Application Support/Adobe/Flash CS4/language/Configuration/Commands

documentation.

Tip: Save your git rep wherever you want and just create an alias from the proper file and move it to the Adobe's structure.

How it works?

The FlashImportAndPlace basically reads your selection (in the timeline or library) and, based on the file's names the script will figure out where they should be added and positioned.

I strongly recommend using only the files You have exported using the PhotoshopExportLayers.jsx because they have the proper names that this script understands.

If you prefer exporting everything by yourself, its up to you! Just follow the pattern file_name_PosXxPosY.extension. I.E.: background_100x20.png = background will be placed in x 100 and y 20.

This script works in two different ways:

A - Importing to Flash:

1. Go to File/Import to Stage, and select the files you want to add.

2. After importing usually Flash keeps all imported files selected (if not, select just the files you want do place properly).

3. Go to Command menu and choose the FlashImportAndPlace option.

4. When the dialog box is opened, type "1" (without quotes) and confirm.

B - Adding existents items from your library:

1. Select in your flash's library the images you want to add. 

2. Go to Command menu and choose the FlashImportAndPlace option.

3. When the dialog box is opened, type "0" (without quotes) and confirm.

4. Well done! Now the script will add every selected image into a new layer and place them all in the right place.

Important: This script was developed and tested basically for the very first moment You create the flash file and added its assets. All default Flash's configurations were kept.

You can also create your own Movieclip and name it following the pattern above, and it will works, but if you change the register point is almost certain that the script will fail.

Remeber, this is almost a kick-off script!


For more information:

photoshop

flash api

flash docs

These scripts were tested in cs4 and cs5 (Mac OS 10.6 and 10.5).

Happy coding!

from-photoshop-to-flash's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.