<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Maxscript to Photoshop: Can't find correct argument for Selection.Select() in 3ds Max Programming Forum</title>
    <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-to-photoshop-can-t-find-correct-argument-for-selection/m-p/13666743#M29017</link>
    <description>&lt;P&gt;if&amp;nbsp;the&amp;nbsp;area&amp;nbsp;was&amp;nbsp;empty ，select&amp;nbsp;was&amp;nbsp;forbidden&lt;/P&gt;</description>
    <pubDate>Thu, 05 Jun 2025 01:07:40 GMT</pubDate>
    <dc:creator>A娘</dc:creator>
    <dc:date>2025-06-05T01:07:40Z</dc:date>
    <item>
      <title>Maxscript to Photoshop: Can't find correct argument for Selection.Select()</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-to-photoshop-can-t-find-correct-argument-for-selection/m-p/13665693#M29016</link>
      <description>&lt;P&gt;I'm learning to manipulate Photoshop through Maxscript, and I'm just trying to select a specific area of the Photoshop document using [document].Selection.Select [region]. But I can't figure out how to pass the [region] argument, everything I try kicks an error of some kind. Does anyone have experience with this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;ps = CreateOLEObject"Photoshop.Application" -- launches Photoshop
doc = ps.application.documents.add 200 200 -- create a new document, 200 by 200 pixels
doc.Selection.Select #(0, 0, 100, 100) -- attempt to select an area, but it kicks an error&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 04 Jun 2025 13:05:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-to-photoshop-can-t-find-correct-argument-for-selection/m-p/13665693#M29016</guid>
      <dc:creator>TurboChiken</dc:creator>
      <dc:date>2025-06-04T13:05:58Z</dc:date>
    </item>
    <item>
      <title>Re: Maxscript to Photoshop: Can't find correct argument for Selection.Select()</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-to-photoshop-can-t-find-correct-argument-for-selection/m-p/13666743#M29017</link>
      <description>&lt;P&gt;if&amp;nbsp;the&amp;nbsp;area&amp;nbsp;was&amp;nbsp;empty ，select&amp;nbsp;was&amp;nbsp;forbidden&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jun 2025 01:07:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-to-photoshop-can-t-find-correct-argument-for-selection/m-p/13666743#M29017</guid>
      <dc:creator>A娘</dc:creator>
      <dc:date>2025-06-05T01:07:40Z</dc:date>
    </item>
    <item>
      <title>Re: Maxscript to Photoshop: Can't find correct argument for Selection.Select()</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-to-photoshop-can-t-find-correct-argument-for-selection/m-p/13667646#M29022</link>
      <description>&lt;P&gt;I wasn't able to get .select() to work, but I was able to write a workaround function by selecting the entire canvas, scaling the selection down to the correct size, and then translating it as needed:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;-- Given a document reference, this selects the given area. x1 and y1 are the top left, and x2 and y2 are the bottom right.
-- Couldn't figure out how to use the .select() command, so we're using a workaround by selecting everything, then resizing and translating.
fn selectArea doc x1 y1 x2 y2 = (	
	
	doc.selection.selectAll()
	local arr=doc.selection.bounds.dataArray
	local currWidth=arr[3]-arr[1], currHeight=arr[4]-arr[2]	
	local newWidth=x2-x1, newHeight=y2-y1	
	local scaleX=newWidth/currWidth*100, scaleY=newHeight/currHeight*100

	doc.selection.resizeBoundary (scaleX) (scaleY) 1 -- 1 means anchored in top left
	doc.selection.translateBoundary x1 y1	
)&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 05 Jun 2025 11:48:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/maxscript-to-photoshop-can-t-find-correct-argument-for-selection/m-p/13667646#M29022</guid>
      <dc:creator>TurboChiken</dc:creator>
      <dc:date>2025-06-05T11:48:28Z</dc:date>
    </item>
  </channel>
</rss>

