• 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: Scope riddle I can't seem to solve. (Probably very easy to solve for an experienced coder)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Scope riddle I can't seem to solve. (Probably very easy to solve for an experienced coder)


  • Subject: Re: Scope riddle I can't seem to solve. (Probably very easy to solve for an experienced coder)
  • From: Ted Wrigley <email@hidden>
  • Date: Fri, 21 Mar 2014 12:41:50 -0700

no I didn’t actually test it; I just did a quick vetting of the provided code, and obviously missed a couple of things. However, I did mention the problem further down in my post.  both ‘activate’ and ‘(less obviously) 'get address’ seem to be application object commands which are not recognized by sub-objects.  THis tests out thought:

tell application "Microsoft Excel"
set WB to workbook 1


tell WB
set WS1 to sheet 1
set WS2 to sheet 2
set WS3 to sheet 3


my getAddress()


tell WS1
activate object
my getAddress()
end tell
end tell
end tell

on getAddress()
tell application "Microsoft Excel"
return get address of active cell
end tell
end getAddress

On Mar 21, 2014, at 12:00 PM, email@hidden wrote:

From: Christopher Stone <email@hidden>
Subject: Re: Scope riddle I can't seem to solve. (Probably very easy to solve for an experienced coder)
Date: March 21, 2014 at 8:52:43 AM PDT
To: Applescript Users List <email@hidden>


On Mar 21, 2014, at 10:00, Ted Wrigley <email@hidden> wrote:
Still a scope issue, because you went a little overboard.  :-)  note the following:
______________________________________________________________________

Hey Ted,

Did that code actually work for you?  It fails here.  { Microsoft Excel 14.3.9 on OSX 10.9.2 }

Note the FAIL comments:

-------------------------------------------------------------------------------------------
tell application "Microsoft Excel"
set WB to workbook "TestBook.xlsx" # SUFFIX REQUIRED IN WORKBOOK NAME.

tell WB
set WS1 to sheet "Goofy1"
set WS2 to sheet "Goofy2"
set WS3 to sheet "Goofy3"

get address of active cell # FAIL!

tell WS1
activate # FAIL!
get address of active cell # FAIL!
end tell

end tell
end tell

-------------------------------------------------------------------------------------------

--
Best Regards,
Chris


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Prev by Date: Re: Scope riddle I can't seem to solve. (Probably very easy to solve for an experienced coder)
  • Next by Date: Re: QT 7 "save as self contained" not working
  • Previous by thread: Re: Scope riddle I can't seem to solve. (Probably very easy to solve for an experienced coder)
  • Next by thread: Re: QT 7 "save as self contained" not working
  • Index(es):
    • Date
    • Thread