• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Code referenced by variable runs but variable undefined
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Code referenced by variable runs but variable undefined


  • Subject: Re: Code referenced by variable runs but variable undefined
  • From: kai <email@hidden>
  • Date: Mon, 10 Jul 2006 02:32:50 +0100


On 9 Jul 2006, at 21:05, polibek wrote:

The underlying problem is that I misunderstood what I was doing with that variable. So, if the goal is to reference a command that doesn't return a result (like resize image current document width (docWidth * 0.5)), should it be done as script object, handler, or something else? Or is that just not allowed?

I suppose the question is really why you're trying to get a result in the first place, polibek. In other words, what kind of value are you hoping to get - and what would you do with it, once you had it stored in a variable?


If you don't really need a result (or can't get one anyway), then there's nothing to be gained from assigning it a variable. Going back to my simple 'beep' example, we wouldn't normally say:

--------
set some_variable to beep
--------

Instead, we'd just use:

--------
beep
--------

Similarly, instead of saying:

--------
set imgHalfSize to resize image current document width (docWidth * 0.5)
--------

You could simply use:

--------
resize image current document width (docWidth * 0.5)
--------

I may be misunderstanding your general aim here, but it looks as if you're trying to resize an image to a specific maximum dimension. In PS, I'd probably try to do that with something like:

--------

tell application "Adobe Photoshop CS" to tell current document
	set {docHeight, docWidth} to {height, width}
	if docHeight > docWidth then
		if docHeight > 1000 then resize image height 1000
	else
		if docWidth > 1000 then resize image width 1000
	end if
end tell

--------

---
kai


_______________________________________________ Do not post admin requests to the list. They will be ignored. Applescript-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Code referenced by variable runs but variable undefined (From: polibek <email@hidden>)
 >Re: Code referenced by variable runs but variable undefined (From: Emmanuel <email@hidden>)
 >Re: Code referenced by variable runs but variable undefined (From: polibek <email@hidden>)
 >Re: Code referenced by variable runs but variable undefined (From: kai <email@hidden>)
 >Re: Code referenced by variable runs but variable undefined (From: polibek <email@hidden>)

  • Prev by Date: Re: Keys Pressed
  • Next by Date: Attivating the display dialog window
  • Previous by thread: Re: Code referenced by variable runs but variable undefined
  • Next by thread: Indesign layer stacking method? / is there a over 31 characters file path handler? / up one folder command?
  • Index(es):
    • Date
    • Thread