Cut and paste the model part of the Photoshop image to .csv

Hi all

I have my own javascript to determine what portion (coordinates) of an image I want to cut.

But what codes can I add to my javascript to paste the image into a model of excel (.csv) that I've prepared on the desktop?

And if the above is possible, how then to control which row/column in excel (.csv) will be the image stuck in?

That's because excel (.csv) is a model, so I need the image to be stuck only in certain rows/columns...

Can someone help me?

Thank you very much in advance.

Very strange, I created the relevant folders and everything seems to work ok here, so don't know what is 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);
}

Tags: Photoshop

Similar Questions

  • Service existing AppleScript Automator to cut and paste the same image in a conversation of Messages

    New to Applescript/Automator-

    I want to be able to have a simple shot that will allow me to paste a particular image in a conversation in Messages... It is the same image that I want every time. But I want to avoid having to go to Messages, search for image copy and then turn over Messages to paste.  I didn't need the script to automatically display the message, simply cut and paste of the pictures folder so that I am in Messages in a new message to the existing message thread (it makes no sense to me). Be good for this service in the Messages and be available to a hot key combination!

    You might want to try the following script to copy and paste an image in the images folder. To launch the script with a quick access key, use FastScripts (free up to 10 keyboard shortcuts).

    the value thePictureName to "Test.jpg".

    value thePicture to (path to the folder images as text) & thePictureName as alias

    say application 'Finder '.

    activate

    thePicture reveal

    end say

    delay 1

    say application 'System events' to hit 'c' using {control down}

    say application "Messages".

    activate

    if not visible from the window 1 then

    say application 'System events' to hit '0' using {control down}

    end if

    end say

    delay 1

    say application 'System events' to hit 'v' {control down}

  • Can I make the recognition of text on PDF files in order to be able to cut and paste on their part on my iPad?

    can I do the recognition of text on PDF files so that I can cut and paste on their part on my iPad?

    Hi Stuart,

    You can perform the OCR using Acrobat desktop approx. You can copy - paste PDFs on the iPad but not to cut-and - paste text.

    Kind regards
    Rahul

  • Where is the copy or cut and paste the toolbar?

    Where is the copy or cut and paste the toolbar?  How can I register my toolbar with the bold, italic, buttons etc.?

    Hello

    1 are. what application you referring?

    If you use word, then check out these links and check if it helps:

    http://Office.Microsoft.com/en-us/Word-help/create-a-custom-toolbar-HP003085155.aspx

    http://Office.Microsoft.com/en-us/Word-help/customize-your-toolbars-and-menus-RZ001003635.aspx

    It will be useful.

  • In one of the inDesign tutorials instructor pulls up what looks like an application bar that contains among other things a text editor to cut and paste the copy into the inDesign project.  That is a feature of inDesign, and how is it accessible?

    In one of the inDesign tutorials instructor pulls up what looks like an application bar that contains among other things a text editor to cut and paste the copy into the inDesign project.  That is a feature of inDesign, and how is it accessible?

    The instructor used the App Switcher on Mac to switch to a text editor and copy this text editor text. InDesign is not the active application.

  • It seems that wrapped text will not host photo resizing without cutting and pasting the image resized, is - what the Muse way is suppose to work?

    It seems that wrapped text will not host photo resizing without cutting and pasting the image resized, is - what the Muse way is suppose to work?

    It would be the default path to wrap the text with the image when you work in Design view.

    This document explains more:

    https://helpx.Adobe.com/Muse/using/wrapping-text-image.html

    Thank you

    Sanjit

  • Cut and pasted the code does not

    Help!

    I created a quiz slide - d├⌐poser following a tutorial online.  It has worked well.  Then I made another.  I cut and pasted the code of the job file in the new and changed the names of the instances of clip.  When you export (control + enter) I can pick up the MCs I want but I can't give up.  they just get stuck on the slider until I click on another MC.  I went through the code and I can't find anything wrong.  It simply doesn't get it.  I'm puzzled.  Here is the work and no working versions:

    DOES NOT WORK

    var counter: Number = 0;

    var startX:Number;

    var startY: number;

    volume_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);

    volume_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt);

    poids_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);

    poids_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt);

    temperature_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);

    temperature_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt)

    vitesse_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);

    vitesse_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt)

    consomation_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);

    consomation_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt)

    pression_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);

    pression_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt)

    surface_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);

    surface_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt)

    function pickUp(event:MouseEvent):void {}

    event.target.startDrag (true);

    reply_txt.text = "";

    event.target.parent.addChild (event.target);

    startX = event.target.x;

    startY = event.target.y;

    }

    function dropIt(event:MouseEvent):void {}

    event.target.stopDrag ();

    var myTargetName:String = "target" + event.target.name;

    var myTarget:DisplayObject = getChildByName (myTargetName);

    If (event.target.dropTarget! = null & & event.target.dropTarget.parent == myTarget) {}

    reply_txt.text = "very well!"

    event.target.removeEventListener (MouseEvent.MOUSE_DOWN, Pick-up);

    event.target.removeEventListener (MouseEvent.MOUSE_UP, dropIt);

    event.target.buttonMode = false;

    event.target.x = myTarget.x;

    event.target.y = myTarget.y;

    counter ++;

    } else {}

    reply_txt.text = "try again!";

    event.target.x = startX;

    event.target.y = startY;

    }

    if(Counter == 7) {}

    reply_txt.text = "Congratulations!"

    }

    }

    volume_mc.buttonMode = true;

    poids_mc.buttonMode = true;

    temperature_mc.buttonMode = true;

    vitesse_mc.buttonMode = true;

    consomation_mc.buttonMode = true;

    pression_mc.buttonMode = true;


    WORK

    var counter: Number = 0;

    var startX:Number;

    var startY: number;

    phalanges_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);

    phalanges_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt);

    metacarpiens_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);

    metacarpiens_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt);

    carpiens_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);

    carpiens_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt)

    cubitus_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);

    cubitus_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt)

    radius_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);

    radius_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt)

    humerus_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);

    humerus_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt)

    omoplate_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);

    omoplate_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt)

    function pickUp(event:MouseEvent):void {}

    event.target.startDrag (true);

    reply_txt.text = "";

    event.target.parent.addChild (event.target);

    startX = event.target.x;

    startY = event.target.y;

    }

    function dropIt(event:MouseEvent):void {}

    event.target.stopDrag ();

    var myTargetName:String = "target" + event.target.name;

    var myTarget:DisplayObject = getChildByName (myTargetName);

    If (event.target.dropTarget! = null & & event.target.dropTarget.parent == myTarget) {}

    reply_txt.text = "very well!"

    event.target.removeEventListener (MouseEvent.MOUSE_DOWN, Pick-up);

    event.target.removeEventListener (MouseEvent.MOUSE_UP, dropIt);

    event.target.buttonMode = false;

    event.target.x = myTarget.x;

    event.target.y = myTarget.y;

    counter ++;

    } else {}

    reply_txt.text = "try again!";

    event.target.x = startX;

    event.target.y = startY;

    }

    if(Counter == 7) {}

    reply_txt.text = "Congratulations!"

    }

    }

    phalanges_mc.buttonMode = true;

    metacarpiens_mc.buttonMode = true;

    carpiens_mc.buttonMode = true;

    cubitus_mc.buttonMode = true;

    radius_mc.buttonMode = true;

    humerus_mc.buttonMode = true;

    omoplate_mc.buttonMode = true;

    When you about to reg alignment are you slam away them?   to test using:

    var counter: Number = 0;
    var startX:Number;
    var startY: number;

    volume_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);
    volume_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt);

    poids_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);
    poids_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt);

    temperature_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);
    temperature_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt);

    vitesse_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);
    vitesse_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt);

    consomation_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);
    consomation_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt);

    pression_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);
    pression_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt);

    surface_mc.addEventListener (MouseEvent.MOUSE_DOWN, Pick-up);
    surface_mc.addEventListener (MouseEvent.MOUSE_UP, dropIt);

    function pickUp(event:MouseEvent):void {}
    event.currentTarget.startDrag ();
    event.currentTarget.parent.addChild (event.currentTarget);
    startX = event.currentTarget.x;
    startY = event.currentTarget.y;
    }

    function dropIt(event:MouseEvent):void {}
    reply_txt. Text = "John";
    event.currentTarget.stopDrag ();
    var mycurrentTargetName:String = "currentTarget" + event.currentTarget.name;
    var mycurrentTarget:DisplayObject = getChildByName (mycurrentTargetName);
    If (event.currentTarget.dropcurrentTarget! = null & event.currentTarget.dropcurrentTarget.parent == mycurrentTarget) {}
    reply_txt. Text = "very well!"
    event.currentTarget.removeEventListener (MouseEvent.MOUSE_DOWN, Pick-up);
    event.currentTarget.removeEventListener (MouseEvent.MOUSE_UP, dropIt);
    event.currentTarget.buttonMode = false;
    event.currentTarget.x = mycurrentTarget.x;
    event.currentTarget.y = mycurrentTarget.y;
    counter ++;
    } else {}
    reply_txt. Text = "try again!";
    event.currentTarget.x = startX;
    event.currentTarget.y = startY;
    }
    if(Counter == 7) {}
    reply_txt. Text = "Congratulations!"
    }
    }
    volume_mc.buttonMode = true;
    poids_mc.buttonMode = true;
    temperature_mc.buttonMode = true;
    vitesse_mc.buttonMode = true;
    consomation_mc.buttonMode = true;
    pression_mc.buttonMode = true;
    surface_mc.buttonMode = true;

  • How to cut and paste the image of the body of the received email

    I'm trying to cut and paste an image included in the bottom of an email and insert it into a Word document so that you can size and print. I can highlight, cut it with Ctrl C, paste it into the document Word with Ctrl V, but the image doesn't show, although the picture frame appears when I click on the place where the photo was pasted. Framework, but empty, no image. Any thoughts?

    Thanks to everyone for their help.

    The problem has been resolved - to try and finally understand everything.

    If you encounter this problem, it is perhaps because, unless you know the file format of the inserted picture, programs can not figure it out for you. Place your cursor on the image, right click and save the image under a .jpeg instead of simply copying. Then work with the file .jpeg in any photo management program you use normally - or even insert it in Word.

  • The use of paint to cut and paste the face and body in photo?

    Original title: need to paint support

    I want to use the face of a person to a photo, cut and paste on another body.  Any suggestions on how to do it?  I am trying to create a flyer for a birthday party

    Cut it out, open the other image, paste it in, edit by pixel until it seems as you want.

    Paint is not sophisticated enough to do much more than that. Heh

    With the help of paint

    Video on the use of paint

    Probably something similar to what you want (video)

    Really what you ask (video)

    In case you thought that my answer has been simplified...
    http://www.WikiHow.com/change-the-look-of-faces-in-Microsoft-Paint

  • Cut and paste the text of the anchored text box?

    CS4, Mac G5, Leopard.

    I've recently been investigating scripts in InDesign and I have a problem to solve that exceeds my, base, understand.

    I used Rorohiko "Lightning Brain text exporter" to extract text (rtf) of a book.

    The text contains countless anchor text blocks. I would like to be able to select all the text in the block of text anchored, cut and paste it into the document where the anchor element is referenced, and then remove the anchor text (now empty) block.

    Any help would be accepted with gratitude

    Thanks Steve

    A full javascript (from the previous post on the forum):

    myDocument var = app.activeDocument;

    Inlines (myDocument);

    function inlines (doc) {}
    var doc.stories = St;
    for (var i = doc.stories.length - 1; I > - 1; i--) {}
    While (st [i].textFrames.length > 0) {}
    var ix = st [i] .textFrames [-1].parent.index;
    St [i] .textFrames [-1] .texts [0] .move (LocationOptions.after, st [i] .insertionPoints [ix]);
    St [i] .textFrames [-1] .locked = false;
    St [i] .textFrames [-1]. Remove();
    }
    }
    }

  • Cut and paste the tables of a project to another

    When cut and paste existing tables from one project to another, the weight of the line for the cell borders appear to vary randomly - some are the original line weight and some are heavier when pasted.

    I tried to unravel with the properties of the table, but without result dialog.

    Is there a quick fix or I'm better import in all subjects, then changing any theme?

    Hi Colum/Peter,

    It is not a custom table, I just need to copy a table from one project to the other.

    Blasted my developers (may the fleas of a thousand camels, etc), recently decided to change toolbars in one of our applications. As this toolbar appears in slightly different forms in about 6 tabs, I tried to update the table that shows which icon does what and cut and paste this table in all subprojects that I. Each table then needs only a minor modification for some this subproject-specific icons.

    Peter on the right track. When I cut and glued to the table, it is also stuck in a number of lines of HTML associated with styles in the other project. If I delete these lines, the table will appear as it should.

    Thanks for the quick reply

  • I unchecked "Check spelling as you type", but Firefox always stresses words cut-and-paste the text in some web applications. How can I stop doing that?

    I use an online web mapping application that has an entry of descriptive text boxes and stuff like that. Sometimes I copy blocks of text from a word-processing application in these input boxes because I can format the text in the wp. When I paste text blocks, Firefox don't the red wavy underline on the words he doesn't know. I already disabled "check spelling as you type" but it does make a difference. I don't want no Firefox to check the spelling on these blocks of text that I copy and paste. Sometimes I need to capture images of these blocks of text display in the mapping application and I want that they own. Thank you.

    Hi, cor - el, this isn't have a tick in the context menu. but I think I was just stupid on the problem because I restarted my browser and now the underline is not past. Thanks for the reply.

    Tim

  • Why can I most add links to the emails simply cut and paste the link, and then hit return?

    Hi... I just noticed lately that when I want to insert a link in an e-mail, I can't simply copy the address, paste in my message and press return for the address to become a link. I now have to Ctrl-click on the highlighted address and 'Add link' to make a link. the former simplified function just disappeared with an update? any help would be appreciated... Thank you!

    Restart your computer, and then try again.

  • Simple cut and past the text in JS please

    Hello world. A big problem I always had with Indesign, is that I can't seem to remove shift as a keyboard shortcut for cutting text. (This is the shortcut, I grew up with and could never get used to the use of Ctrl-X, that I prefer to use for other things). In my view, there is a fundamental bug which means that this shortcut will not work. (In the box keyboard shortcuts dialog, 'cut' is listed under the Edit menu. It works on the text boxes and objects when assigned to 'default', but not in the selected text when the 'text' option is used.)

    Therefore, I thought I'd try to assign the shortcut to a simple piece of JS code. Can someone give me the syntax if you please. Can follow programming languages, I am new to JS and despite playing for a few hours, that I can't seem to find the code to cut the selected text in the Clipboard.

    Thank you very much

    John

    code for cutting:

    App.Cut)

  • Witch part of this code must be copy and paste the following image so that the enemies have the same reactions as frame 1. Copy the following code is in the image 1.

    var enemy1Array:Array = new Array();  
      
    for (var e1:int = numChildren - 1; e1 >= 0; e1--)
      
    {
      
    var childe1:DisplayObject = getChildAt(e1);
      
    if (childe1.name.indexOf("enemy")>-1)
      
    {
      enemy1Array
    .push(MovieClip(childe1));
      
    MovieClip(childe1).hitPoints=enemykoufoueshitpoints;
      
    }
      
    }
      stage
    .addEventListener(Event.ENTER_FRAME,loop);
      
    function loop(event:Event):void
      
    {
      
    for(var e:int=enemy1Array.length-1;e>=0;e--)
      
    {
      
    if (playerrun == true)
      
    {
      enemy1Array
    [e].x -=speedall;
      
    }
      
    if (playerrunback == true)
      
    {
      enemy1Array
    [e].x +=speedall;
      
    }
      
    if (enemy1Array[e].hitTestPoint(player.x+5,player.y-40))
      
    {
      trace
    ("i heart the player");
      zoihit
    ++;
      enemy1Array
    [e].x +=70;
      enemy1Array
    [e].gotoAndPlay(1);
      
    }
      
    if (enemy1Array[e].hitTestPoint(player.x-5,player.y-40))
      
    {
      trace
    ("i heart the player");
      zoihit
    ++;
      enemy1Array
    [e].x -=70;
      enemy1Array
    [e].gotoAndPlay(1);
      
    }
      
    if (enemy1Array[e].hitTestObject(knife)&&attackright == true)
      
    {
      attackright
    = false;
      enemy1Array
    [e].hitPoints -= knifedamage;
      enemy1Array
    [e].gotoAndPlay(1);  
      
    }
      
    if (enemy1Array[e].hitTestObject(knife)&&attackleft == true)
      
    {
      attackleft
    = false;
      enemy1Array
    [e].hitPoints -= knifedamage;
      enemy1Array
    [e].gotoAndPlay(1);  
      
    }
      
    if (enemy1Array[e].hitPoints <= 0)
      
    {  
      
    var thkiamantoui:thkiamanti= new thkiamanti;
      diamondArray
    .push(thkiamantoui);
      
    this.addChild(thkiamantoui);
      thkiamantoui
    .gotoAndStop(2);
      thkiamantoui
    .x = enemy1Array[e].x;
      thkiamantoui
    .y = enemy1Array[e].y-5.05;
      enemy1Array
    [e].parent.removeChild(enemy1Array[e]);
      enemy1Array
    .splice(e,1);  
      
    }
      
    if(enemy1Array[e].hitTestObject(dioswall))
      
    {  
      enemy1Array
    [e].parent.removeChild(enemy1Array[e]);
      enemy1Array
    .splice(e,1);
      
    }  
      
    }
      
    if(stage2.hitTestObject(playerhit))
      
    {
      stage
    .removeEventListener(Event.ENTER_FRAME,loop);
      gotoAndPlay
    (2);
      
    }
      
    }

    Try:

    enemy1Array.length=0
    for (e1 = numChildren - 1; e1 >= 0; e1--)
    {
    childe1 = getChildAt(e1);
    if (childe1.name.indexOf("enemy")>-1)
    {
    enemy1Array.push(MovieClip(childe1));
    MovieClip(childe1).hitPoints=enemykoufoueshitpoints;
    }
    }
    stage.addEventListener(Event.ENTER_FRAME,loop);

Maybe you are looking for

  • Lost all that Candy Crush levels with updated iOS 9.3

    I did the update for IOS 9.3 last night and lost all levels of Candy Crush. Went from 125 to 1. Even lost the five bars of gold that was purchased. How to bring back the lost levels?

  • Turn on Apple TV after its been asleep

    Received a model Apple TV A1625. Set up, listened to music, watched a few shows from Netflix. Before going to bed, put Apple TV in standby via the remote control according to the instructions. Today, tried to turn on the Apple TV with the remote cont

  • Cursor jumps around... help!

    I have an Asus laptop and everything by typing the cursor tends to jump around so that I constantly have to correct words, place the cursor at the end of the sentence, etc.  Question is, how do eliminate you this problem?

  • the paintings... Printing errors

    I can not print anything on the web, I've tried troubleshooting, but they confuse me more, I can do a test page for the printer only, can't do any of the computor... He has always worked, but can't seem to find a solution, the pilot stated that it wo

  • White blackBerry Smartphones My World blue screen, apps do not work

    I've updated wrongly OS6 in my Bold 9700, the phone did not work well when I realized that I demoted software to the latest version OS5. Since then, when I try to access the info in Myworld on an application, the screen is blank, I can close the butt