• 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: Script error in applications Script Menu
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Script error in applications Script Menu


  • Subject: Re: Script error in applications Script Menu
  • From: Jeremy K Sellors <email@hidden>
  • Date: Tue, 26 Jul 2005 06:19:41 -0700


On 24-Jul-05, at 5:47 PM, Paul Berkowitz wrote:

Actually, because Apple's Standard Additions "bought" (I think Jon once said
they gave him a computer) the clipboard/set the clipboard from Jon's
Commands, the raw code for 'the clipboard' in Standard Additions is also

    «event JonsgClp»

Matt was wrong in assuming it meant you had compiled it with Jon's Commands
present.

So the fact that the script you're running can't compile it means that
you're somehow either missing Standard Additions from the
/System/Library/ScriptingAdditions/ folder (??), or something may be wrong
with your installation of AppleScript. If Standard Additions is installed as
it should be, then the script should compile and run  «event JonsgClp» as
'the clipboard' whether in an application tell block or not.
I went to check if the Standard Additions was in the /System/Library/ScriptingAdditions/ folder and accidentally double clicked the addition which opened its dictionary in Apples Script Editor. While «event JonsgClp» was always compiling  as 'the clipboard' but generated an error 'Canvas does not understand «event JonsgClp»' but only when run from the Canvas Script Menu. the script runs as expected from the Apple's system wide Script Menu.
However Canvas' copy was compiling as «event misccopy» when using Script Debugger 3.0.9 but compiled OK with Apple's Script Editor 2.1(80).
It would appear that Canvas' Script Menu does not want to have anything to do with —the clipboard — unless I could run a script to paste in the Dictionary app outside the Canvas Script Menu but I don't know how to do that.


I went back to look at your script. Although you prepare against the
clipboard being empty at the very top:

try --incase the clipboard is empty
    set clip to the clipboard --get old clipboard
end try
set the clipboard to "" --clear clipboard word count works


you later 

tell application "Canvas™X"
    --
    copy -- I haven't found how to get the selected text without using the
clipboard in Canvas.
end tell
set dickLookUp to the clipboard



If 'copy' fails, then perhaps dickLookUp fails too. It may be that Canvas's
'copy' is putting something unparseable into the clipboard. However, before
you despair, it seems you missed this comment in 'the clipboard's dictionary
entry:


the clipboard -- Return the contents of an application’s clipboard. Use in a
‘tell’ block after activating the application

You haven't activated the application, have you? So try that first:

tell application "Canvas™X"
    activate
    set x to selection
    --etc.


Of course since you're running it from Canvas's script menu, Canvas ought to
be activated already. But you never know...

It may be that Canvas does not use the standard clipboard and/or whatever it
puts there isn't of a class that can be accessed.
I think this is correct. For some reason Canvas's script menu is not able to access Standard Additions and so it generates the error 'Canvas does not understand «event JonsgClp»' I will take this up with Canvas' support.
Incidentally the Canvas dictionary will not open with Apple's Script Editor but dose open with Script Debugger.
What's the whole dictionary in Canvas for 'copy'? And what are you copying
there? (If text, what sort of text?)
from Canvas' dictionary:
copy: Copy an object to the clipboard
    copy 
The text is ordinary selected text in a text object in edit mode.
 This script runs fine from the Apple's Scripts Menu so it is not a big issue. I think it is a problem with Canvas' Script menu so I will wait to hear from their support.
Thanks for your help.

 _______________________________________________
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: 
 >Re: Script error in applications Script Menu (From: Paul Berkowitz <email@hidden>)

  • Prev by Date: Re: Grabbing info from a webpage
  • Next by Date: Re: Grabbing info from a webpage
  • Previous by thread: Re: Script error in applications Script Menu
  • Next by thread: Script application "bundles" that are read-only: error when quitting
  • Index(es):
    • Date
    • Thread