Re: Script error in applications Script Menu
Re: Script error in applications Script Menu
- Subject: Re: Script error in applications Script Menu
- From: Paul Berkowitz <email@hidden>
- Date: Sun, 24 Jul 2005 17:47:44 -0700
- Thread-topic: Script error in applications Script Menu
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 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 "CanvasX"
--
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 "CanvasX"
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.
What's the whole dictionary in Canvas for 'copy'? And what are you copying
there? (If text, what sort of text?)
--
Paul Berkowitz
> From: Jeremy K Sellors <email@hidden>
> Date: Sun, 24 Jul 2005 17:14:21 -0700
> To: <email@hidden>
> Subject: Re: Script error in applications Script Menu
>
> I an still having a problem with this. I am using Script debugger to
> compile but I cant find any sign of Jon's Commands in any
> ScriptingAdditions folder.
> I tried compiling using Apples Script Editor 2.1 and ran the script
> from Canvas but that bought the sky down and I had to reboot OS X
> Is the problem with the phrasing of the script?
>
> On 20-Jul-05, at 6:30 AM, Matt Neuburg wrote:
>
>> On Sun, 17 Jul 2005 17:41:27 -0700, Jeremy K Sellors
>> <email@hidden>
>> said:
>>
>>> doesn't understand the <<event JonsgClip >>message.
>>
>> You've compiled your original script using Jon's Commands. This is not
>> needed in Mac OS X simply in order to manipulate the clipboard,
>> since there
>> are now standard-additions commands that do the same thing. m.
> _______________________________________________
> 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
>
_______________________________________________
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