I’ve made a new service to target v7. As with previous ones, it takes the clipboard contents and pastes it ot the front TB’s window view as a new note.
If the app is not open or no doc is open there is a silent fail - by design, I want to keep it simple.
If I clip something to Tbx in Outline view, it leaves the new note being edited. This seems to be the standard behaviour for pasting text from the clipboard onto an Outline view.
So if I then clip something else, this second clipping overwrites the first note’s title while leaving the first note text untouched.
I think adding a “return” keysteroke after the paste would fix it?
-- paste clipboard contents
keystroke "v" using command down
-- v7 needs a short delay (0.05s)
delay 0.05
-- close the new note from title edit mode
keystroke return
I don’t think I can set it any shorter. But the left-in-edit mode issue seems to have gone away.
I’ll leave the URL bit as an Exercise for the user, as the service works when something in the front app - not necessarily a browser - has a selection. I’m not sure how you tell if the front most app is a browser (given their names can vary. Here’s where in the internal AppleScript (open the service file in automator) you add the extra logic
tell application "System Events" to set activeApplication to bundle identifier of 1st process whose frontmost is true
set the clipboard to input as Unicode text
-- add code here to detect app, URL, append URL to above clipboard value
I’ve no idea why these services are MB rather than KB in size. I guess there’s lots of framework stuff bundled in by Automator. Opening the package of the safari service (14MB!) the actual visible assets are c.60kb. I can only assume there are hidden files in the package as zipping only reduces the Zip to c13.7MB. Odd.
If the case of both services, only the first sentence is used for the note title. What I hadn’t noticed is that if a note is selected and focus is in the text pane, the entire clipboard selection is added after the current insertion point, i.e. the insertion point is not moved. Thus if a second such clip is made it will insert before the last one and with no spacing added. As Tinderbox isn’t applescript-able the user will just have to move the cursor themselves between clips if clipping into a note.
using “Clip_Safari_Selection-URL_to_Tinderbox_v7.zip” for me results in a new note in TB showing twice the clipped ULR in $Text without populating it to $URL.
No, it doesn’t and can’t set $URL as Tinderbox lacks AppleScript support for such an action. Let’s say you’re at www.example.com/somepage.htm and you select 2 sentences “This is one. This is the second”. When you use the clipping and Tinderbox’s focus is - as intended - in the view (left) pane the result is:
$Name: This is one.
$Text:
This is one. This is the second.
www.example.com/somepage.htm
If you’ve put put the focus somewhere else, e.g. the $Text pane you will get an unexpected result.
I’m not a programmer and the service file is not supported software, just something I tried out as a fellow Tinderbox user. If it doesn’t work as desired, you can use Automator to edit it and alter the code to make a new version that suits your needs. I’m no expert in services so likely you’ll have more success than me.
I’m having difficulty installing this extension. Normally I just download something with the .popclipextz extension and it installs. This is lacking the “z” and well, I just thought I’d ask rather than puzzle it out. #AttorneyNotACoder
You can change the extension to ‘z’: doesn’t matter. They are regular zip files. You can extract and zip yourself as well. This is the config file you need to put in.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Actions</key>
<array>
<dict>
<key>Image File</key>
<string>hlite.png</string>
<key>Service Name</key>
<string>Clip Selection to Tinderbox v7</string>
<key>Title</key>
<string>TB</string>
</dict>
</array>
<key>Extension Description</key>
<string>Make a clip of with the selected text to TB.</string>
<key>Extension Identifier</key>
<string>com.eastgate.Tinderbox-7</string>
<key>Extension Name</key>
<string>Clip to Tinderbox</string>
<key>Required OS Version</key>
<string>10.7</string>
<key>Version</key>
<integer>2</integer>
</dict>
</plist>