Cut and Paste part of image from Photoshop to .csv template

Hi all,
I have my own javascript to determine which portion(coordinates) of an image i wish to cut.
But what codes can i add to my javascript to paste the image into an excel(.csv) template that i've prepared on the desktop?
And if the above is possible, how then to control which row/column in the excel(.csv) will the image be pasted in?
This is because the excel(.csv) is a Template, thus i will need the image to be pasted only in certain row/column...
Can someone help me?
Thanks so much in advance.

Very strange, I created the relevant folders and it all seems to work ok here, so don't know what's gone wrong?
#target photoshop
function main(){
if(!documents.length) return;
var paper_no=900;
var Excel = File("~/desktop/myfolder/records/"+Number(paper_no)+".xls");
var Cell ="C22";
if(!Excel.exists){
    alert("SpreadSheet does not exist!");
    return;
try{
var SB = app.activeDocument.selection.bounds;
}catch(e){return;}
app.activeDocument.selection.copy();
var Width = SB[2].as('px') - SB[0].as('px');
var Height = SB[3].as('px') - SB[1].as('px');
var doc = app.documents.add(UnitValue(Width,'px'),UnitValue(Height,'px'),72);
app.activeDocument.paste();
doc.flatten();
var tmpFile = File(Folder.temp +"/deleteMe.jpg");
if(tmpFile.exists) tmpFile.remove();
SaveForWeb(tmpFile,60);
app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);
var VBS = File(Folder.temp +"/VBS.vbs");
VBS.open('w');
VBS.writeln('Set objExcel = CreateObject("Excel.Application")');
VBS.writeln('Set objWorkbook = objExcel.Workbooks.Open("'+decodeURI(Excel.fsName)+'")');
VBS.writeln('objExcel.Visible = false');
VBS.writeln('Set mypic = objWorkbook.ActiveSheet.Pictures.Insert("'+decodeURI(tmpFile.fsName)+'")');
VBS.writeln('mypic.Top = objWorkbook.ActiveSheet.Range("'+Cell+'").Top');
VBS.writeln('mypic.Left = objWorkbook.ActiveSheet.Range("'+Cell+'").Left');
VBS.writeln('mypic.Width = objWorkbook.ActiveSheet.Range("'+Cell+'").Width');
VBS.writeln('mypic.Height = objWorkbook.ActiveSheet.Range("'+Cell+'").Height');
VBS.writeln('objExcel.ActiveWorkBook.Close True');
VBS.close();
VBS.execute();
main();
function SaveForWeb(saveFile,jpegQuality) {
var sfwOptions = new ExportOptionsSaveForWeb();
   sfwOptions.format = SaveDocumentType.JPEG;
   sfwOptions.includeProfile = false;
   sfwOptions.interlaced = 0;
   sfwOptions.optimized = true;
   sfwOptions.quality = jpegQuality;
activeDocument.exportDocument(saveFile, ExportType.SAVEFORWEB, sfwOptions);

Similar Messages

  • What product do I need to easily cut and paste parts of a photo?

    What product do I need to EASILY cut and paste parts of a photo

    Hi there
    Try going through this step-by-step guide on how to select and move parts of an image: http://forums.adobe.com/docs/DOC-2781

  • Can no longer drag or cut and paste links or words from one place to another with new Firefox update

    After updating Firefox 19.0.2 to my iMac Desktop 10.8.2, Lion, I can no longer drag or cut and paste anything to anywhere, anymore. Please help. Thanks!

    Does this also happen if you try to copy/cut and paste text in a text area like "Post a Reply" on this forum?
    Try to reinstall Firefox.<br />
    Download a new copy of the Firefox program and save the disk image (dmg) file to the desktop
    *Firefox 19.0.2: http://www.mozilla.org/en-US/firefox/all.html
    *Trash the current Firefox application (e.g. open the Applications folder in the Finder and drag the Firefox application to the Trash) to do a clean (re-)install
    *Install the new version that you have downloaded
    *https://support.mozilla.org/kb/Installing+Firefox+on+Mac
    Your profile data is stored elsewhere in the Firefox Profile Folder, so you won't lose your bookmarks and other personal data if you uninstall and (re)install Firefox.
    *http://kb.mozillazine.org/Profile_folder_-_Firefox

  • Copy and/or Cut and Paste no longer works from within Firefox yet I can Paste to Notepad and yet again copy the same text from within Notepad or any app will not Paste back into Firefox, thanks

    I 'Copy & Paste' from within Firefox quite often but for some reason the function has stopped working when using some sites, even the menu item 'Paste' is greyed out, yet I can open Notepad and 'Paste'. I tried pasting into 'Notepad' then copying from Notepad and pasting back into Firefox, which I've found in the past sometimes works but today even that does not work. I accept it may not actually be a Firefox problem but I have noticed since upgrading to the latest version, I am having several problems with crashing and hanging exceedingly long execution of the browser.

    See:
    *http://kb.mozillazine.org/Clipboard_not_working

  • I need to make a copy of an entire email, including the header w/the sender's info and time, etc. to insert into a letter, etc. How can I do this w/out cutting and paste and doing the header separately from the text.

    I need to make a copy of an entire email, including the header w/the sender's info and time, etc. to insert into a letter, etc. How can I do this w/out cutting and pasting   the header separately from the text. I know there is a way besides a screen shot but I've spend hours trying to find it.

    Smurfslayer wrote:
    For the particularly persnickety types you might want to expose the full headers in the email message as well.  It's easy enough to do, from mail's 'menu' select "view"; then "message"; then all headers.
    Another option you could use is a screen capture using Grab.
    Activate Grab, then shift + command + w (for a window screen shot).  Then confirm the window selection and click the mail message. 
    Dave
    Why are you addressing this to me...?
    I am not the OP...

  • My Copy/Cut and Paste Solution (if possible)

    I sent this to Apple:
    I know there's been a lot of people saying they need/want a cut/copy & paste feature.
    I was thinking about this tonight and realized that with a touch screen that needs to control a lot, incorporating "clicking and dragging" becomes somewhat a challenge. I don't know if it's possible to do with a software update (through iTunes) but here two ideas...
    First, in either idea, a "copy arrow" would need to be included in the touch keyboard. It would look like a cursor key arrow pointing to the right.
    Idea #1 - Cursor arrow is a "sticky" key, so you hit it once and it stays selected until you hit it again.
    Using a finger or the cursor magnifying glass, the user could place their cursor at the beginning of the text they want to highlight. They then click on the sticky arrow key. Using a finger or the cursor magnifying glass they place the cursor at the end of the text they want to highlight. The text now shows highlighted. Click the sticky arrow key again to copy the text and clear the highlight.
    Idea #2 - Cursor arrow highlights as it's selected.
    Using a finger or the cursor magnifying glass, the user places their cursor at the beginning of the text they want to highlight/copy. They then click on the copy arrow key (or hold it down) until they reach the end of the text they wish to copy. As they highlight, content highlighted is copied to the clipboard automatically. Clicking anywhere on the screen clears the highlight (and retains what is highlighted on the clipboard).
    Being Apple, you may have a more elegant solution than me... but I thought I'd share it none-the-less.
    What do you think?

    I was going to cut and paste part of another post about this but...
    I think that th simplest initial implementation of copy/cut/paste is to have a clipboard icon that turns on a selection function with its own pallete of keys. (cut, copy, paste, select all, select none, delete selection, and my favorite desperately needed button... copy to notes)
    Once in clipboard mode, single tap selects a ord, double tap selects a sentence, triple tap selects the paragragh, and a select all button selects the entire text within the frame.
    Perhaps there should also be a button that looks like your cursor with the arrow. however, it would have to be set to highlight from one complete word to another and not from the exact point of touch.
    Man do I wish that I could copy and paste this into my own post from earlier.

  • How do I display, copy, and paste a web address from an open Safari window please?

    I'm new to Mac and Safari. 
    I'm used to being able to just cut and paste a web address from a page I'm on into a discussion, but I don't see an address bar to copy from.
    I'm sure it is there somewhere, which toolbar or keyboard shortcut am I missing, please?
    Gordon_M

    Hello:
    While Safari is open, go to the menu bar>view.  Select "customize toolbar."  You may use the default, or customize it to yoru liking.
    Then when you wish to copy an address, you simply click on the favicon and go to edit>copy.
    Barry

  • I can't cut and paste and the mac doesn't see me as the admin

    Okay so here are my current frustrations and issues:
    1. I can't cut and paste anything! Not from emails, not in documents, nothing.
    2. I went to make changes in the utilities and when I started, under my name, it said admin and now it says standard and the computer won't allow me to make changes. I try to enter my name and password and the computer says I am not the admin.
    3. I can't delete the "test" user and "guest" user because apparantly there is no admin.
    I have rebooted using the install disk and I was able to change the passwords but I still can't get in as the admin.
    Is there a way to override this before I a) pull out all of my hair, my husbands hair and the hair belonging to my cat and/or b) before I throw the machine out the window and then have another frustration that the unit is not working?! 

    First back up all your data, if you haven't done so already.
    Boot in safe mode (shift key down at startup) and check to see whether the clipboard now works. If it does, reboot as usual (not in safe mode) and try again.
    Next, boot in single-user mode by restarting the computer and holding down the Command and S keys at the chime, until you see white text on a black background. Wait for the text to stop scrolling, then follow the instructions on the screen, which will tell you run the fsck and mount commands. Be very, very careful to type the commands correctly. After you enter the mount command, please enter this:
    rm /var/db/.AppleSetupDone
    Then this:
    exit
    The Mac will now boot up as if for the first time. Go through the setup procedure to create a new admin account with the same name and password as the old one.

  • How can I copy and paste my edited Photo in photoshop elements 12?

    How can I copy and paste my edited photo from photoshop elements 12 into a word document?

    In full Editor:
    Go to Select menu>all
    Go to Edit menu>copy to put it on the clipboard
    Go to your destination document>Paste
    Hope that this works for you as well.

  • Why doesn't my "Numbers" email address file cut and Paste to an Outlook Email?

    I used to be able to cut and paste an email file from Numbers into an address for an Outlook email message. Now , the cut and paste truncates the addresses. The operation works but not in the Outlook address space. Help!

    see attached for File Handling settings.  see any problems there?
    thanks for reponding!

  • How can  I cut-and-paste more than 256 charecters here?

    How can I cut-and-paste a question here from a Notepad file?

    Forget this, it now seems to be working.

  • Cut and paste wrong text!

    Adobe Cut and paste wrong text!
    A simple cut and paste a street address from a rebate PDF
    When I go to paste the address in notepad, the street address is COMPLETELY DIFFERENT! 
    I right click on the text there is NO hyperlink.  The address is valid, just another branch office. 
    how is this possible? 
    I can not trust cut and paste from Adobe!

    Shared Files - Acrobat.com
    On the right hand side of page 1
    Mail to:
    Florida City Gas Rebates Offer
    xxxxxxx
    xxxxxx
    xxxxxx
    Carefully note what it says on the screen  (El Paso TX)
    NOW cut and paste it into word, notepad
    it changes the address to CA!

  • Copy and Paste Images from Photoshop

    I can INSERT psd, jpg, (any) image files into Dreamweaver. I
    can COPY text from Word or Internet. I can COPY images off of
    Internet...
    ...but I can NOT copy from Photoshop (jpg or psd) into
    Dreamweaver. Simply does not copy. Paste is not an option. Grayed
    out. Hmmm. Any ideas?

    @Michael Fesser
    I expect that upon entering Ctrl+V or Paste at an insertion
    point in Dreamweaver, to be greeted with the "Optimize for Web
    & Devices" dialogue box, after which I input the appropriate
    settings (a jpg, gif, or png file is created), the image would
    appear in the document just as though I inserted it via myriad
    other conventional methods.
    I'm taking the Lynda tutorial (Dreamweaver CS4 Essentials)
    and following along EXACTLY, and am unable to recreate the copy and
    paste from Photoshop.
    Also, see this Adobe Dreamweaver Help & Support Tutorial
    http://www.adobe.com/designcenter/dreamweaver/articles/lrvid4043_dw.html
    Go down about halfway to: Cutting and Pasting from Photoshop
    into Dreamweaver
    I cannot recreate what is shown here either.
    @toastieo
    Yes, the Save For Web is how I've done things all along. Now
    I'm taunted with the prospect of doing a quick edit and insert with
    copy & paste, and it doesn't work for me! I guess I can live
    without it, but I would have rather been blissful in my ignorance
    of the possibility!
    Zyg

  • Cut and Paste images from flash to power point

    Can you cut and paste images from flash player to power point?
    Thanks!

    Are the settings for the two Sequences completely indentical?
    -DH

  • Cut and Paste from Reader to Outlook

    Hi,
    Here is my problem - hopefully someone can help me out with a solution
    I have had a flyer designed by someone which is essentially in 2 parts - an image at the top and some narrative at the bottom. It has been converted from Corel Draw into a .pdf file
    I want to send it out in the body of an email (not as an attachment)
    I have tried to cut and paste it into the body of the email but only the image gets copied and not the narrative.
    When I try to select the full area by going to the top left and thenleft click and hold and drag the range down to the bottom right it all appears to be selected as it all goes into shadow - however when I release the left mouse button the area in shadow jumps back so that it only covers the image part and not the narrative part.
    Any help gratefully received...Regards....John

    Hi knopper, Welcome to Apple's Users Help Users Forums.
    This should work. :~)
    1] cmd shift 4 brings up a cross hair.
    2] drag cross hair across the map and release.
    3] see the png file, maybe jpg, on your desktop or where you have system store new things.
    4] open to make sure its what you want.
    5] copy it into word.
    If that works, I like Green or Gold stars. See Apple info on the email alerts.
    Thanks, Joyous Computing, JP

Maybe you are looking for

  • Error while creating new scheduler

    Hi, While creating a scheduler using KMScheduler, I get the below error import java.util.Properties; import com.sapportals.wcm.WcmException; import com.sapportals.wcm.service.*; import com.sapportals.wcm.service.scheduler.*; public class extract impl

  • Payment Reference Field KIDNO Not apprearing at the time of Vendor Payment

    Hi, When we are making the Vendor Payment thru F-53, we are not able to see the Payment Reference Field KIDNO there. But when the payment document is posted and we see the line items then this field KIDNO comes there as non-modifiable field. We want

  • WebUtil

    On 2007 I used CLIENT_HOST Command *(WebUtil)* in one of my applications without any problem. Now I would like to know if possible to use an existing report (This report contained groups and breaks, summary and "PDF" format) to convert to excel forma

  • Help we column chart display

    HI, I'm extending my dashboard to display printer information. From the sample data below I want to display, each printers job total count for each quarter. Bottom access should show Q2-07,Q3-07-Q1-08 vertical axis should show integers. From the tabl

  • HOW can u calculate the average it wont calculate

    import java.util.*; public class Percentage public static void main (String [] args) System.out.println("Enter marks (value < 0 to stop"); int totalMarks = 0; int numberOfMarks = 0; Scanner input= new Scanner (System.in); int nextMark = input.nextInt