Jump to content

Accordance Widget in Maverick?


David Padfield

Recommended Posts

After installing Maverick I am no longer to able to use the "Auto Insert" option in the Accordance Widget. Instead, I get this note: "UI Scripting is not enabled. Please check ‘Enable access for assistance devices’ in the Universal Access pane of System Preferences to enable Auto Search." I was finally able to figure out that this part of the Universal Access pane has been moved to "System Preferences > Security & Privacy > Privacy > Accessibility", but I still can't get the widget to auto insert text? Any suggestions?

 

post-18816-0-84726400-1382755753_thumb.png

Link to comment
Share on other sites

Joel,

You can use keystroke within System events without the permissions problem in a Widget's utility script. The problem with the copypaste.scpt in the Widget is that it's accessing the menus with UI scripting. To see what I mean, in that helper script, remove the block that is checking for the presence of a "past and match style" menu item, replacing it just with the keystroke command.

So, remove

tell frontApp to tell menu bar 1
	if (exists menu item "Paste and Match Style" of menu "Edit") then
		click menu item "Paste and Match Style" of menu "Edit"
	else if (exists menu item "Paste" of menu "Edit") then
		click menu item "Paste" of menu "Edit"
	else
		tell application "System Events" to keystroke "v" using {command down}
	end if
end tell

and replace it with

keystroke "v" using {command down}

and the widget's auto pasting works. You lose the "paste and match style" capability, unfortunately.

You could add an if clause for the most common apps that have the standard key command:

if (name of frontApp) is in {"Word", "Pages", "Keynote"} 
-- whatever apps use ⌘⌥⇧v for match style
keystroke "v" using {command down, shift down, option down}
else
keystroke "v" using {command down}
end
  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

 

Joel,

You can use keystroke within System events without the permissions problem in a Widget's utility script. The problem with the copypaste.scpt in the Widget is that it's accessing the menus with UI scripting. To see what I mean, in that helper script, remove the block that is checking for the presence of a "past and match style" menu item, replacing it just with the keystroke command.

So, remove

tell frontApp to tell menu bar 1
	if (exists menu item "Paste and Match Style" of menu "Edit") then
		click menu item "Paste and Match Style" of menu "Edit"
	else if (exists menu item "Paste" of menu "Edit") then
		click menu item "Paste" of menu "Edit"
	else
		tell application "System Events" to keystroke "v" using {command down}
	end if
end tell

and replace it with

keystroke "v" using {command down}

and the widget's auto pasting works. You lose the "paste and match style" capability, unfortunately.

You could add an if clause for the most common apps that have the standard key command:

if (name of frontApp) is in {"Word", "Pages", "Keynote"} 
-- whatever apps use ⌘⌥⇧v for match style
keystroke "v" using {command down, shift down, option down}
else
keystroke "v" using {command down}
end

 

Joe,

 

So, if I understand you correctly, I can still get the widget to work in the way that you mentioned, that is, without the "Paste and match style," until Accordance finds out how to fix the widget. Is this to be done in Terminal? Can you tell me a little bit more on how to do this? If I open terminal, where do I go from there? Thanks!

 

Don Ruhl

Link to comment
Share on other sites

Hey, Don,

 

I don't oversee the widget, so was simply offering the fix for improve upon and publish, but I'll offer an easy how to diy.

 

1. Locate the file Accordance.wdgt

It is in ~/Library/Widgets/. In order to get to the folder, go to Finder, hold down the Option key, and select menu item Go/Library.

 

2. Right-click or Control-click on the Accordance.wdgt file and choose "Show Package Contents"

 

3. Locate the file copypaste.scpt inside the /Scripts/ folder

 

4. Double click that file which will open it up in Applescript Editor

 

5. Find and select these 9 lines:

tell frontApp to tell menu bar 1
    if (exists menu item "Paste and Match Style" of menu "Edit") then
        click menu item "Paste and Match Style" of menu "Edit"
    else if (exists menu item "Paste" of menu "Edit") then
        click menu item "Paste" of menu "Edit"
    else
        tell application "System Events" to keystroke "v" using {command down}
    end if
end tell

6. Delete and replace them with

keystroke "v" using {command down}

7. Save and quit Applescript Editor. The paste-in option will now work in the Widget.

 

Note: if you'll only be using the widget to paste into an app that uses command+option+shift+v as the shortcut for "Paste and match style, you can make that happen by instead putting in the script:

keystroke "v" using {command down, shift down, option down}
  • Like 2
Link to comment
Share on other sites

Joe,

 

I finally got around to trying your temporary solution until Accordance can fix the problem. Thanks, your work around proved successful! I rely upon the widget heavily, so this was a great relief to me!

Link to comment
Share on other sites

  • 4 weeks later...

Joe,

 

Thank you for the detailed work around, your help is greatly appreciated.

 

I would like to see this remedied in future updates, I also use the widget extensively.

Edited by circuitrider
  • Like 1
Link to comment
Share on other sites

I was wondering if someone is still working on the Wiget or if it has been abandoned? I use it over 100 times a week (at least) and don't want to upgrade my main computer to Mavericks if it means I lose the functionality of the Widget.

  • Like 2
Link to comment
Share on other sites

  • 4 weeks later...

Joe,

 

Thanks again for posting the work around.

 

When I use it in Pages '09 it always pastes in Helvetica when I have the 'auto insert' box checked. Is there a command line I can add so it will match the present formatting? I can work around it by unchecking 'auto insert' and then utilizing the copy button and then pasting with match formatting hot-key stroke. However, I would like to avoid that extra step if possible.

 

Thank you.

Link to comment
Share on other sites

Joe,

 

Thanks again for posting the work around.

 

When I use it in Pages '09 it always pastes in Helvetica when I have the 'auto insert' box checked. Is there a command line I can add so it will match the present formatting? …

 

I'm very glad the solution is working for you.

Yes, as I gave as an addendum in the previous instructions, you can do it easily if you'll only be using the auto paste in apps that use command+option+shift+v to paste and match style like Pages, Word and TextEdit:

Note: if you'll only be using the widget to paste into an app that uses command+option+shift+v as the shortcut for "Paste and match style, you can make that happen by instead putting in the script:

keystroke "v" using {command down, shift down, option down}

 

use that line instead of the keystroke "v" using {command down} line that you previously added. Let me know if it's confusing or is not working.

If you need to work in more than one app, it is even possible to change the code to say:

If front app is Pages, then use command option shift v

otherwise use just command v

etc.

Link to comment
Share on other sites

Joe,

 

I did indeed use:

 

keystroke "v" using {command down, shift down, option down}

 

I was still getting Helvetica.

 

Within Pages I looked at the Edit drop down menu and for some reason my shortcut key-stroke is "⌘V" to paste and match style, so I changed the command line to read:

 

keystroke "v" using {option down, shift down, command down}

 

And it worked! That made my day.

 

Thank you for responding and also for sharing your "script magic" with us. Greatly appreciated.

Link to comment
Share on other sites

1.6.7 of the Widget has been posted here:

 

http://www.accordancebible.com/Accordance-Installers#Widget

 

It fixes the ability to Auto Insert from the widget. Auto Search still doesn't work in Mavericks and may never work, due to the new security restrictions. But, that can be worked around without too much hassle.

  • Like 1
Link to comment
Share on other sites

Joel,

 

When I downloaded the file I received this error

 

 

"Accordance.wdgt" can't be opened because it is from and unidentified developer.

Link to comment
Share on other sites

You'll need to go to System Preferences -> Security -> General and allow the widget. You might have to set it to allow from 'Anywhere' to install the new version, then return it to your prior setting.

Link to comment
Share on other sites

Thanks Joel, that worked.

 

However, I had downloaded the file twice and now I get two instances of the widget when pressing the dashboard key!

 

I deleted all of the accordance widgets in Library/Widgets and still get two.

 

Thanks for the help.

Link to comment
Share on other sites

You can remove open instances of the widget by holding the Option key and mousing over the widget. So, close one, but ensure the remaining one does report 1.6.7.

Link to comment
Share on other sites

Got it!

 

A your instructions and a re-start fixed things up.

 

Thank you very much.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...