Re: Assigning Keystroke to Scratchpad

2011-09-07 Thread gary
Thanks Chris, the second script works as advertised. It is a tad bit
slower than the first one. I haven't gotten around to running it as a
compiled script but I will soon. Thanks again. Been using it every
day.

Philippe, I'm guessing what you're saying is that script simply uses
what keyboard maestro gives you. I haven't yet figured out how that
needs to be used (I'm still learning how to use keyboard maestro), but
when I do I'll give it a try :)

cheers,
gary



On Aug 29, 2:08 pm, Philippe Martin  wrote:
> Why using Keyboard Maestro if you do it all in AppleScript? :)
>
> It's very easy to do in "pure KM":
>
> - If condition met execute action
>         all of the following are true
>                 the front window
>                         title is
>                                 "Scratchpad"
>         execute the following actions:
>                 - type the cmd-w keystroke
>                 - use variable "FrontApp"
>                         to set the front application by name
> otherwise execute the following actions
>         - set variable "FrontApp"
>                 to %CurrentApplication%
>         - activate BBEdit.app
>         - pause until condition met
>                 all of the following are true
>                         a menu
>                                 with this name
>                                         Show Scratchpad
>                                 is enabled
>         - select a menu item
>                 in BBEdit.app
>                         Menu title "Window"
>                         Menu item "Show Scratchpad"
>
> Assign it a hot key and you're done.
>
> All the best,
>
> Philippe
>
> On 29 août 2011, at 07:19, Christopher Stone wrote:
>
>
>
>
>
>
>
>
>
> > On Aug 28, 2011, at 18:33, Christopher Stone wrote:
> >> I'm sort of ticked with the irregularities, so I'll probably rewrite the 
> >> script tomorrow.
>
> > __
>
> > Hey Gary,
>
> > Okay.  This script bypasses all but BBEdit and Keyboard Maestro.  It runs a 
> > trifle faster if you run it as a compiled script rather than as text.
>
> > --
> > Best Regards,
> > Chris
>
> > --- 
> > --
> > ## OPEN BBEDIT SCRATCHPAD ##
> > --- 
> > --
> > on openScratchpad()
> >   tell application "BBEdit"
> >     open scratchpad window
> >     activate
> >     set index of window "Scratchpad" to 1 # Workaround for hidden apps 
> > issue.
> >   end tell
> > end openScratchpad
> > --- 
> > --
> > ## RESTORE NAMED APPLICATION ##
> > --- 
> > --
> > on kmRestoreApp()
> >   tell application "Keyboard Maestro Engine"
> >     do script "
> >             Action
> >             SetApplicationByNameMatches
> >             IsActive
> >             
> >             IsDisclosed
> >             
> >             MacroActionType
> >             UseVariable
> >             Variable
> >             restoreAppKM
> >           "
> >     set value of variable "restoreAppKM" to "FALSE"
> >   end tell
> > end kmRestoreApp
> > --- 
> > --
> > try
> >   tell application "Keyboard Maestro Engine"
> >     set currentApp to process tokens "%CurrentApplication%"
> >     try
> >       set restoreApp to value of variable "restoreAppKM"
> >     on error
> >       make new variable with properties {name:"restoreAppKM", value:"FALSE"}
> >     end try
> >     if currentApp ≠ "BBEdit" then
> >       set value of variable "restoreAppKM" to currentApp
> >       openScratchpad() of me
> >     else if currentApp = "BBEdit" then
> >       if value of variable "restoreAppKM" = "FALSE" then
> >         openScratchpad() of me
> >       else
> >         kmRestoreApp() of me
> >       end if
> >     end if
> >   end tell
> > on error errMsg number errNum
> >   set sep to "=="
> >   set e to sep & return & "Error: " & errMsg & return & sep & return ¬
> >     & "Error Number: " & errNum & return & sep
> >   beep
> >   tell application "System Events" to display dialog e
> > end try
> > --- 
> > --
>
> > --
> > You received this message because you are subscribed to the
> > "BBEdit Talk" discussion group on Google Groups.
> > To post to this group, send email to bbedit@googlegroups.com
> > To unsubscribe from this group, send email to
> > bbedit+unsubscr...@googlegroups.com
> > For more options, visit this group at
> > 
> > If you have a feature request or would like to report a problem,
> > please email "supp...@barebones.com" rather than posting to the group.
> > Follow @bbedit on Twitter: 

Re: Assigning Keystroke to Scratchpad

2011-08-29 Thread gary
Thanks Chris, will definitely try this out.

On Aug 29, 3:56 pm, Christopher Stone 
wrote:
> On Aug 29, 2011, at 14:08, Philippe Martin wrote:
>
> > Why using Keyboard Maestro if you do it all in AppleScript? :)
>
> __
>
> Hey Philippe,
>
> Why ask why?  :)
>
> A) The Applescript mostly drives Keyboard Maestro.
>
> B) I wanted to provide a near TURNKEY solution for Gary.
>
> C) I wanted to learn more about driving KM with XML, because this provides a 
> means to build on-the-fly macros.
>
> D) I haven't learned all the ins and outs of KM5's conditionals yet.
>
> E) I'd rather send events than drive the UI when possible.
>
> I'll try out your method later as an exercise and see what I think.
>
> --
> Best Regards,
> Chris

-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 


Re: Assigning Keystroke to Scratchpad

2011-08-29 Thread Christopher Stone
On Aug 29, 2011, at 14:08, Philippe Martin wrote:
> Why using Keyboard Maestro if you do it all in AppleScript? :)

__

Hey Philippe,

Why ask why?  :)

A) The Applescript mostly drives Keyboard Maestro.

B) I wanted to provide a near TURNKEY solution for Gary.

C) I wanted to learn more about driving KM with XML, because this provides a 
means to build on-the-fly macros.

D) I haven't learned all the ins and outs of KM5's conditionals yet.

E) I'd rather send events than drive the UI when possible.

I'll try out your method later as an exercise and see what I think.

--
Best Regards,
Chris

-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 


Re: Assigning Keystroke to Scratchpad

2011-08-29 Thread Philippe Martin
Why using Keyboard Maestro if you do it all in AppleScript? :)

It's very easy to do in "pure KM":

- If condition met execute action
all of the following are true
the front window 
title is 
"Scratchpad"
execute the following actions:
- type the cmd-w keystroke
- use variable "FrontApp"
to set the front application by name
otherwise execute the following actions
- set variable "FrontApp"
to %CurrentApplication%
- activate BBEdit.app
- pause until condition met
all of the following are true
a menu
with this name
Show Scratchpad
is enabled
- select a menu item
in BBEdit.app
Menu title "Window"
Menu item "Show Scratchpad"

Assign it a hot key and you're done.

All the best,

Philippe



On 29 août 2011, at 07:19, Christopher Stone wrote:

> On Aug 28, 2011, at 18:33, Christopher Stone wrote:
>> I'm sort of ticked with the irregularities, so I'll probably rewrite the 
>> script tomorrow.
> 
> __
> 
> Hey Gary,
> 
> Okay.  This script bypasses all but BBEdit and Keyboard Maestro.  It runs a 
> trifle faster if you run it as a compiled script rather than as text.
> 
> --
> Best Regards,
> Chris
> 
> -
> ## OPEN BBEDIT SCRATCHPAD ##
> -
> on openScratchpad()
>   tell application "BBEdit"
> open scratchpad window
> activate
> set index of window "Scratchpad" to 1 # Workaround for hidden apps issue.
>   end tell
> end openScratchpad
> -
> ## RESTORE NAMED APPLICATION ##
> -
> on kmRestoreApp()
>   tell application "Keyboard Maestro Engine"
> do script "
> Action
> SetApplicationByNameMatches
> IsActive
> 
> IsDisclosed
> 
> MacroActionType
> UseVariable
> Variable
> restoreAppKM
>   "
> set value of variable "restoreAppKM" to "FALSE"
>   end tell
> end kmRestoreApp
> -
> try
>   tell application "Keyboard Maestro Engine"
> set currentApp to process tokens "%CurrentApplication%"
> try
>   set restoreApp to value of variable "restoreAppKM"
> on error
>   make new variable with properties {name:"restoreAppKM", value:"FALSE"}
> end try
> if currentApp ≠ "BBEdit" then
>   set value of variable "restoreAppKM" to currentApp
>   openScratchpad() of me
> else if currentApp = "BBEdit" then
>   if value of variable "restoreAppKM" = "FALSE" then
> openScratchpad() of me
>   else
> kmRestoreApp() of me
>   end if
> end if
>   end tell
> on error errMsg number errNum
>   set sep to "=="
>   set e to sep & return & "Error: " & errMsg & return & sep & return ¬
> & "Error Number: " & errNum & return & sep
>   beep
>   tell application "System Events" to display dialog e
> end try
> -
> 
> 
> -- 
> You received this message because you are subscribed to the 
> "BBEdit Talk" discussion group on Google Groups.
> To post to this group, send email to bbedit@googlegroups.com
> To unsubscribe from this group, send email to
> bbedit+unsubscr...@googlegroups.com
> For more options, visit this group at
> 
> If you have a feature request or would like to report a problem, 
> please email "supp...@barebones.com" rather than posting to the group.
> Follow @bbedit on Twitter: 

__
 Philippe MARTIN 
 http://flip.macrobyte.net




-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 


Re: Assigning Keystroke to Scratchpad

2011-08-28 Thread Christopher Stone
On Aug 28, 2011, at 18:33, Christopher Stone wrote:
> I'm sort of ticked with the irregularities, so I'll probably rewrite the 
> script tomorrow.

__

Hey Gary,

Okay.  This script bypasses all but BBEdit and Keyboard Maestro.  It runs a 
trifle faster if you run it as a compiled script rather than as text.

--
Best Regards,
Chris

-
## OPEN BBEDIT SCRATCHPAD ##
-
on openScratchpad()
  tell application "BBEdit"
open scratchpad window
activate
set index of window "Scratchpad" to 1 # Workaround for hidden apps issue.
  end tell
end openScratchpad
-
## RESTORE NAMED APPLICATION ##
-
on kmRestoreApp()
  tell application "Keyboard Maestro Engine"
do script "
Action
SetApplicationByNameMatches
IsActive

IsDisclosed

MacroActionType
UseVariable
Variable
restoreAppKM
  "
set value of variable "restoreAppKM" to "FALSE"
  end tell
end kmRestoreApp
-
try
  tell application "Keyboard Maestro Engine"
set currentApp to process tokens "%CurrentApplication%"
try
  set restoreApp to value of variable "restoreAppKM"
on error
  make new variable with properties {name:"restoreAppKM", value:"FALSE"}
end try
if currentApp ≠ "BBEdit" then
  set value of variable "restoreAppKM" to currentApp
  openScratchpad() of me
else if currentApp = "BBEdit" then
  if value of variable "restoreAppKM" = "FALSE" then
openScratchpad() of me
  else
kmRestoreApp() of me
  end if
end if
  end tell
on error errMsg number errNum
  set sep to "=="
  set e to sep & return & "Error: " & errMsg & return & sep & return ¬
& "Error Number: " & errNum & return & sep
  beep
  tell application "System Events" to display dialog e
end try
-

-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 


Re: Assigning Keystroke to Scratchpad

2011-08-28 Thread Christopher Stone
Hey Gary,

On Aug 28, 2011, at 14:42, Gary wrote:
> If I may ask one more question. I promise, my last.

Don't worry about asking questions; ask away.  :)

> I was curious though. Something like Simplenote has a preference for a 
> shortcut key. If I'm in Safari and press f11 Simplenote appears. I can then 
> press f11 and its gone, with the focus returned to Safari... Is something 
> like that possible with applescript and keyboard maestro or is that beyond 
> their capabilities?

It's simpler to assign a 'last application' shortcut in Keyboard Maestro and 
then use your global Scratchpad shortcut in combination with that.

However:


property savedFrontAppName : ""

try
  tell application "Finder"
set frontAppName to item 1 of (get name of processes whose frontmost is 
true)
if frontAppName ≠ "BBEdit" then
  set savedFrontAppName to frontAppName
  tell application "BBEdit"
open scratchpad window
activate
  end tell
else
  if savedFrontAppName ≠ "" then
set procNameList to name of processes
if savedFrontAppName is in procNameList then
  set frontmost of processes whose name is savedFrontAppName to true
  set savedFrontAppName to ""
end if
  else
if frontAppName = "BBEdit" then
  tell application "BBEdit" to open scratchpad window
end if
  end if
end if
  end tell
on error errMsg number errNum
  set sep to "=="
  set e to sep & return & "Error: " & errMsg & return & sep & return ¬
& "Error Number: " & errNum & return & sep
  beep
  tell application "System Events" to display dialog e
end try


This is a bit quick and dirty, but it works.

If you hit the Keyboard Maestro hotkey from an application other than BBEdit it 
will activate BBEdit and open the Scratchpad window.

If you have previously done the above it will return you to the application you 
started with.  However if you switch out of BBEdit with some other means than 
the hotkey it will bring you back to BBEdit's Scratchpad.

If you START in BBEdit it will simply open the Scratchpad window.

I decided to use the Finder rather than System Events, because SEV isn't always 
running - so there can be a lag while it starts up.  On the other hand if the 
Finder is really busy there might be a lag.

Give it a try and see what you think.

I just looked and Keyboard Maestro v5 has a %CurrentApplication% property, so 
it should be possible to bypass both the Finder and SEV to iron out any speed 
irregularities.  But I'm done for now.  ;-)

I'm sort of ticked with the irregularities, so I'll probably rewrite the script 
tomorrow.

--
Best Regards,
Chris

-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 


Re: Assigning Keystroke to Scratchpad

2011-08-28 Thread gary
Chris,

If I may ask one more question. I promise, my last.

As I said, everything works great. I can get to the scratchpad no
matter what I'm doing, and quickly. I was curious though. Something
like Simplenote has a preference for a shortcut key. If I'm in Safari
and press f11 Simplenote appears. I can then press f11 and its gone,
with the focus returned to Safari (I don't have to re-click safari or
switch back to it). Is something like that possible with applescript
and keyboard maestro or is that beyond their capabilities?

cheers,
gary

On Aug 27, 10:52 pm, gary  wrote:
> Chris,
>
> Thanks for all the info and help. The global Scratchpad is what I
> want. In fact, this works much better for me now that I realize each
> project has it's own Scratchpad. I'd rather keep them separate. If I
> have something on a global Scratchpad I want to use in a Project I'll
> just copy it over.
>
> The only thing I'm really curious about is why the document called up
> by the apple script doesn't have a .txt extension. But as long is
> doesn't cause problems I'll just ask no questions :)
>
> Again, thanks for your help and patience. I really do appreciate it.
>
> cheers,
> gary
>
> On Aug 27, 8:21 pm, Christopher Stone 
> wrote:
>
>
>
>
>
>
>
> > Hey Gary,
>
> > Thanks for taking the time to suss this out.
>
> > On Aug 27, 2011, at 18:15, gary wrote:
>
> > > The Scratchpad file that is called up when I use Keyboard Maestro lives 
> > > here:
> > > /library/application support/bbedit
>
> > Right.  There lives the global Scratchpad file.
>
> > > There is one strange thing about it. It doesn't show an extension, but 
> > > info says it's a text file. I can see what I've written on it with quick 
> > > view. However, if I click on it to open it the apple script editor opens 
> > > it. I get an error that says "a identifier can't go after this 
> > > identifier".
>
> > Don't worry about that.  It IS odd that it would be associated with the 
> > Applescript Editor on your machine rather than TextEdit but not terribly.
>
> > You can change it in the Finder if you want to.
>
> > The error is caused by the Applescript Editor trying to compile it into 
> > Applescript.
>
> > > I have two projects, and when I click "show package contents" they both 
> > > have a Scratchpad file inside. Each maintains it's own info. And unlike 
> > > the global scratchpad in application support, they do show a .txt 
> > > extension, and when clicked, are opened by bbedit.
>
> > Okay.  I had noticed the 'Scratchpad' and 'Unix Worksheet' items associated 
> > with the project, but I never access them in the file pane and didn't 
> > realize they were part of the project rather than the global files.
>
> > Learn something new and all that...
>
> > > And secondly, should I be concerned that the global Scratchpad in bbedit 
> > > application support shows no extension, and is set to be opened with the 
> > > apple script editor?
>
> > No.
>
> > > I thought this might simply be because the file was created with an apple 
> > > script
>
> > The file is not created with Applescript.  The script simply calls the 
> > global Scratchpad window.
>
> > > and I also thought I could just go to info and change what the file is 
> > > associated with from the apple script editor to bbedit, but I thought I 
> > > might screw something up.
>
> > This should not cause any problems.
>
> > --
>
> > From the BBEdit 10 Release Notes:
>
> > ◦ There's a new command on the Window menu: "Show Unix Worksheet". This 
> > will open a worksheet document that is application-wide, and backed by a 
> > worksheet file saved in your Application Support/BBEdit folder. Like the 
> > Scratchpad, changes here are saved automatically.
>
> > 
There's also a "Unix worksheet window" application property available to 
> > the scripting interface.
>
> > (* Repeated for the Scratchpad)
>
> > --
>
> > ◦ Project windows grow a couple of new lists:
> > ◦ Recently Used: Shows documents recently opened into this project's window.
> > ◦ Scratchpad & Worksheet: Every project document carries its own scratch 
> > pad and worksheet document. This is shared for all users of the project, so 
> > if you wish you can use the scratchpad to make notes for other users; or 
> > store handy commands in the worksheet.
> > ◦ These can be collapsed or hidden, if desired.
>
> > --
>
> > NOW - Back to your original issue:
>
> > Are you wanting to open the GLOBAL Scratchpad or the one LOCAL to your 
> > project file?
>
> > --
> > Best Regards,
> > Chris

-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the g

Re: Assigning Keystroke to Scratchpad

2011-08-27 Thread gary
Chris,

Thanks for all the info and help. The global Scratchpad is what I
want. In fact, this works much better for me now that I realize each
project has it's own Scratchpad. I'd rather keep them separate. If I
have something on a global Scratchpad I want to use in a Project I'll
just copy it over.

The only thing I'm really curious about is why the document called up
by the apple script doesn't have a .txt extension. But as long is
doesn't cause problems I'll just ask no questions :)

Again, thanks for your help and patience. I really do appreciate it.

cheers,
gary

On Aug 27, 8:21 pm, Christopher Stone 
wrote:
> Hey Gary,
>
> Thanks for taking the time to suss this out.
>
> On Aug 27, 2011, at 18:15, gary wrote:
>
> > The Scratchpad file that is called up when I use Keyboard Maestro lives 
> > here:
> > /library/application support/bbedit
>
> Right.  There lives the global Scratchpad file.
>
> > There is one strange thing about it. It doesn't show an extension, but info 
> > says it's a text file. I can see what I've written on it with quick view. 
> > However, if I click on it to open it the apple script editor opens it. I 
> > get an error that says "a identifier can't go after this identifier".
>
> Don't worry about that.  It IS odd that it would be associated with the 
> Applescript Editor on your machine rather than TextEdit but not terribly.
>
> You can change it in the Finder if you want to.
>
> The error is caused by the Applescript Editor trying to compile it into 
> Applescript.
>
> > I have two projects, and when I click "show package contents" they both 
> > have a Scratchpad file inside. Each maintains it's own info. And unlike the 
> > global scratchpad in application support, they do show a .txt extension, 
> > and when clicked, are opened by bbedit.
>
> Okay.  I had noticed the 'Scratchpad' and 'Unix Worksheet' items associated 
> with the project, but I never access them in the file pane and didn't realize 
> they were part of the project rather than the global files.
>
> Learn something new and all that...
>
> > And secondly, should I be concerned that the global Scratchpad in bbedit 
> > application support shows no extension, and is set to be opened with the 
> > apple script editor?
>
> No.
>
> > I thought this might simply be because the file was created with an apple 
> > script
>
> The file is not created with Applescript.  The script simply calls the global 
> Scratchpad window.
>
> > and I also thought I could just go to info and change what the file is 
> > associated with from the apple script editor to bbedit, but I thought I 
> > might screw something up.
>
> This should not cause any problems.
>
> --
>
> From the BBEdit 10 Release Notes:
>
> ◦ There's a new command on the Window menu: "Show Unix Worksheet". This will 
> open a worksheet document that is application-wide, and backed by a worksheet 
> file saved in your Application Support/BBEdit folder. Like the Scratchpad, 
> changes here are saved automatically.
>
> 
There's also a "Unix worksheet window" application property available to the 
> scripting interface.
>
> (* Repeated for the Scratchpad)
>
> --
>
> ◦ Project windows grow a couple of new lists:
> ◦ Recently Used: Shows documents recently opened into this project's window.
> ◦ Scratchpad & Worksheet: Every project document carries its own scratch pad 
> and worksheet document. This is shared for all users of the project, so if 
> you wish you can use the scratchpad to make notes for other users; or store 
> handy commands in the worksheet.
> ◦ These can be collapsed or hidden, if desired.
>
> --
>
> NOW - Back to your original issue:
>
> Are you wanting to open the GLOBAL Scratchpad or the one LOCAL to your 
> project file?
>
> --
> Best Regards,
> Chris

-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 


Re: Assigning Keystroke to Scratchpad

2011-08-27 Thread Christopher Stone
Hey Gary,

Thanks for taking the time to suss this out.

On Aug 27, 2011, at 18:15, gary wrote:
> The Scratchpad file that is called up when I use Keyboard Maestro lives here:
> /library/application support/bbedit

Right.  There lives the global Scratchpad file.
> There is one strange thing about it. It doesn't show an extension, but info 
> says it's a text file. I can see what I've written on it with quick view. 
> However, if I click on it to open it the apple script editor opens it. I get 
> an error that says "a identifier can't go after this identifier".

Don't worry about that.  It IS odd that it would be associated with the 
Applescript Editor on your machine rather than TextEdit but not terribly.

You can change it in the Finder if you want to.

The error is caused by the Applescript Editor trying to compile it into 
Applescript.
> I have two projects, and when I click "show package contents" they both have 
> a Scratchpad file inside. Each maintains it's own info. And unlike the global 
> scratchpad in application support, they do show a .txt extension, and when 
> clicked, are opened by bbedit.

Okay.  I had noticed the 'Scratchpad' and 'Unix Worksheet' items associated 
with the project, but I never access them in the file pane and didn't realize 
they were part of the project rather than the global files.

Learn something new and all that...
> And secondly, should I be concerned that the global Scratchpad in bbedit 
> application support shows no extension, and is set to be opened with the 
> apple script editor?

No.

> I thought this might simply be because the file was created with an apple 
> script

The file is not created with Applescript.  The script simply calls the global 
Scratchpad window.

> and I also thought I could just go to info and change what the file is 
> associated with from the apple script editor to bbedit, but I thought I might 
> screw something up.

This should not cause any problems.

--

>From the BBEdit 10 Release Notes:

◦ There's a new command on the Window menu: "Show Unix Worksheet". This will 
open a worksheet document that is application-wide, and backed by a worksheet 
file saved in your Application Support/BBEdit folder. Like the Scratchpad, 
changes here are saved automatically.


There's also a "Unix worksheet window" application property available to the 
scripting interface.

(* Repeated for the Scratchpad)

--

◦ Project windows grow a couple of new lists:
◦ Recently Used: Shows documents recently opened into this project's window.
◦ Scratchpad & Worksheet: Every project document carries its own scratch pad 
and worksheet document. This is shared for all users of the project, so if you 
wish you can use the scratchpad to make notes for other users; or store handy 
commands in the worksheet.
◦ These can be collapsed or hidden, if desired.

--


NOW - Back to your original issue:

Are you wanting to open the GLOBAL Scratchpad or the one LOCAL to your project 
file?

--
Best Regards,
Chris

-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 


Re: Assigning Keystroke to Scratchpad

2011-08-27 Thread gary
Okay, after fumbling around here's what I've found out. I apologize if
I'm stating the obvious but I've just started using bbedit and have
never done anything with applescript.

The Scratchpad file that is called up when I use Keyboard Maestro
lives here:

/library/application support/bbedit

There is one strange thing about it. It doesn't show an extension, but
info says it's a text file. I can see what I've written on it with
quick view. However, if I click on it to open it the apple script
editor opens it. I get an error that says "a identifier can't go after
this identifier".

I have two projects, and when I click "show package contents" they
both have a Scratchpad file inside. Each maintains it's own info. And
unlike the global scratchpad in application support, they do show
a .txt extension, and when clicked, are opened by bbedit.

If I open either project scratchpad their name is scratchpad.txt. But
when I open the global Scratchpad with my keyboard shortcut, it only
says Scratchpad, without the .txt extension, in the title bar. Which,
I assume, is because of what I mentioned earlier (though it's a text
file it's set to open with the apple script editor).

So to sum up, what I see is one scratchpad not attached to any
project, and a scratchpad for each project I create. That's the only
way it makes sense to me. Am I correct?

And secondly, should I be concerned that the global Scratchpad in
bbedit application support shows no extension, and is set to be opened
with the apple script editor? I thought this might simply be because
the file was created with an apple script, and I also thought I could
just go to info and change what the file is associated with from the
apple script editor to bbedit, but I thought I might screw something
up.

Sorry this is so long and for any confusion.

gary



On Aug 27, 3:22 pm, Christopher Stone 
wrote:
> Hey Gary,
>
> On Aug 27, 2011, at 14:33, gary wrote:
>
> > Thanks Chris! I got it working almost immediately. Works perfectly.
>
> Good.
>
> > The only weird thing is that I have one project, and the Scratchpad 
> > integrated into the project doesn't jive with the generic Scratchpad I get 
> > with other files and by using the keystroke. Do projects have there own 
> > Scratchpad separate from a generic Scratchpad.
>
> That IS weird.  As far as I know you cannot open *the* Scratchpad in a 
> project window.
>
> Is there a 'Last Saved' date and 'File Path' associated with the one in the 
> project?
>
> Could *you* have create your own 'Scratchpad' file and associated it with the 
> project?
>
> What happens if you Command-Click on the menu bar icon one the one in the 
> project?
>
> --
> Best Regards,
> Chris

-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 


Re: Assigning Keystroke to Scratchpad

2011-08-27 Thread gary
Thanks Chris! I got it working almost immediately. Works perfectly.

The only weird thing is that I have one project, and the Scratchpad
integrated into the project doesn't jive with the generic Scratchpad I
get with other files and by using the keystroke. Do projects have
there own Scratchpad separate from a generic Scratchpad.

I looked at the manual but saw nothing about this. Anyone have a clue?



On Aug 26, 10:06 pm, Christopher Stone 
wrote:
> On Aug 26, 2011, at 11:42, gary wrote:
>
> > Ahh, that's what I want, the ability to call it up even if it's not
> > the front most app. I actually have a license for keyboard maestro.
>
> __
>
> Hey Gary,
>
> Run this from an Applescript action in Keyboard Maestro.
>
> --
> Best Regards,
> Chris
>
> __
>
> tell application "BBEdit"
>   try
>     activate
>     open scratchpad window
>   on error errMsg number errNum
>     set sep to "=="
>     set e to sep & return & "Error: " & errMsg & return & sep & return ¬
>       & "Error Number: " & errNum & return & sep
>     beep
>     display dialog e
>   end try
> end tell

-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 


Re: Assigning Keystroke to Scratchpad

2011-08-26 Thread Christopher Stone
On Aug 26, 2011, at 11:42, gary wrote:
> Ahh, that's what I want, the ability to call it up even if it's not
> the front most app. I actually have a license for keyboard maestro.

__

Hey Gary,

Run this from an Applescript action in Keyboard Maestro.

--
Best Regards,
Chris

__


tell application "BBEdit"
  try
activate
open scratchpad window
  on error errMsg number errNum
set sep to "=="
set e to sep & return & "Error: " & errMsg & return & sep & return ¬
  & "Error Number: " & errNum & return & sep
beep
display dialog e
  end try
end tell

-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 


Re: Assigning Keystroke to Scratchpad

2011-08-26 Thread gary
Ahh, that's what I want, the ability to call it up even if it's not
the front most app. I actually have a license for keyboard maestro.
Guess it's time to check it out. Thanks.

On Aug 26, 8:52 am, Philippe Martin  wrote:
> That would work only when BBEdit is the frontmost app, though. To make a 
> globally available hot key you need something like Keyboard Maestro.
>
> Philippe
>
> On 26 août 2011, at 14:05, Ken Lanxner wrote:
>
>
>
>
>
>
>
>
>
> > Preferences -> Menus & Shortcuts -> Window -> Show Scratchpad.
>
> > Click the end of the row with the menu item to add a keystroke.
>
> > Ken
>
> > garyr...@gmail.com (gary) wrote on  8/25/11  11:47 PM
>
> >> I've just started using bbedit 10.  I really like the scratchpad, very
> >> handy. I noticed that you can call on the scratchpad from the dock
> >> icon. Even handier. But that made me wish, since I'm keeping bbedit
> >> open all the time, that I could call up the scratchpad with a simple
> >> key stroke.
>
> >> I thought it might be in preferences, but I don't see it. I did find
> >> this website:
>
> >>http://www.communitymx.com/content/article.cfm?page=4&cid=5F514
>
> >> where the author claims to have done just that, but he doesn't say
> >> how. Any thought or pointers on how to accomplish this would be great.
>
> > --
> > Simple Lives Web Design
> >http://simplelives.com
>
> > --
> > You received this message because you are subscribed to the
> > "BBEdit Talk" discussion group on Google Groups.
> > To post to this group, send email to bbedit@googlegroups.com
> > To unsubscribe from this group, send email to
> > bbedit+unsubscr...@googlegroups.com
> > For more options, visit this group at
> > 
> > If you have a feature request or would like to report a problem,
> > please email "supp...@barebones.com" rather than posting to the group.
> > Follow @bbedit on Twitter: 
>
> __
>  Philippe MARTIN                
>  http://flip.macrobyte.net

-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 


Re: Assigning Keystroke to Scratchpad

2011-08-26 Thread Philippe Martin
That would work only when BBEdit is the frontmost app, though. To make a 
globally available hot key you need something like Keyboard Maestro. 

Philippe



On 26 août 2011, at 14:05, Ken Lanxner wrote:

> Preferences -> Menus & Shortcuts -> Window -> Show Scratchpad.
> 
> Click the end of the row with the menu item to add a keystroke.
> 
> Ken
> 
> garyr...@gmail.com (gary) wrote on  8/25/11  11:47 PM
> 
>> I've just started using bbedit 10.  I really like the scratchpad, very
>> handy. I noticed that you can call on the scratchpad from the dock
>> icon. Even handier. But that made me wish, since I'm keeping bbedit
>> open all the time, that I could call up the scratchpad with a simple
>> key stroke.
>> 
>> I thought it might be in preferences, but I don't see it. I did find
>> this website:
>> 
>> http://www.communitymx.com/content/article.cfm?page=4&cid=5F514
>> 
>> where the author claims to have done just that, but he doesn't say
>> how. Any thought or pointers on how to accomplish this would be great.
>> 
> 
> -- 
> Simple Lives Web Design
> http://simplelives.com
> 
> -- 
> You received this message because you are subscribed to the 
> "BBEdit Talk" discussion group on Google Groups.
> To post to this group, send email to bbedit@googlegroups.com
> To unsubscribe from this group, send email to
> bbedit+unsubscr...@googlegroups.com
> For more options, visit this group at
> 
> If you have a feature request or would like to report a problem, 
> please email "supp...@barebones.com" rather than posting to the group.
> Follow @bbedit on Twitter: 

__
 Philippe MARTIN 
 http://flip.macrobyte.net




-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 


Re: Assigning Keystroke to Scratchpad

2011-08-26 Thread Ken Lanxner
Preferences -> Menus & Shortcuts -> Window -> Show Scratchpad.

Click the end of the row with the menu item to add a keystroke.

Ken

garyr...@gmail.com (gary) wrote on  8/25/11  11:47 PM

> I've just started using bbedit 10.  I really like the scratchpad, very
> handy. I noticed that you can call on the scratchpad from the dock
> icon. Even handier. But that made me wish, since I'm keeping bbedit
> open all the time, that I could call up the scratchpad with a simple
> key stroke.
> 
> I thought it might be in preferences, but I don't see it. I did find
> this website:
> 
> http://www.communitymx.com/content/article.cfm?page=4&cid=5F514
> 
> where the author claims to have done just that, but he doesn't say
> how. Any thought or pointers on how to accomplish this would be great.
> 

-- 
Simple Lives Web Design
http://simplelives.com

-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: 


Re: Assigning Keystroke to Scratchpad

2011-08-26 Thread François Schiettecatte
You can use the "Menu & Shortcuts" preferences to assign keyboard shortcuts to 
pretty much anything (I think).

Cheers

François

On Aug 26, 2011, at 2:47 AM, gary wrote:

> I've just started using bbedit 10.  I really like the scratchpad, very
> handy. I noticed that you can call on the scratchpad from the dock
> icon. Even handier. But that made me wish, since I'm keeping bbedit
> open all the time, that I could call up the scratchpad with a simple
> key stroke.
> 
> I thought it might be in preferences, but I don't see it. I did find
> this website:
> 
> http://www.communitymx.com/content/article.cfm?page=4&cid=5F514
> 
> where the author claims to have done just that, but he doesn't say
> how. Any thought or pointers on how to accomplish this would be great.
> 
> -- 
> You received this message because you are subscribed to the 
> "BBEdit Talk" discussion group on Google Groups.
> To post to this group, send email to bbedit@googlegroups.com
> To unsubscribe from this group, send email to
> bbedit+unsubscr...@googlegroups.com
> For more options, visit this group at
> 
> If you have a feature request or would like to report a problem, 
> please email "supp...@barebones.com" rather than posting to the group.
> Follow @bbedit on Twitter: 

-- 
You received this message because you are subscribed to the 
"BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to bbedit@googlegroups.com
To unsubscribe from this group, send email to
bbedit+unsubscr...@googlegroups.com
For more options, visit this group at

If you have a feature request or would like to report a problem, 
please email "supp...@barebones.com" rather than posting to the group.
Follow @bbedit on Twitter: