I have this for me very useful script:
set textToFind to get the clipboard
tell application "Skim"
set foundText to find front document text textToFind
select foundText with animation
This script would even be more useful if I could also use a Find Next feature (triggered via Keyboard Maestro).
Would that be possible at all?
Your thought involve interaction by a user and the only way I know its possible is with a dialog.
And that could be more complicated and useful.
That said… you could do it with GUI Scripting or use Shortcuts with “System Events”
That also means that future is already possible in Skim so why do you need AS to do it.
Thank you for your feedback!
It made me have another look at Skim and … I found a feature that I should have thought of right away: CMD+G to select the next instance of the Find string (or: to repeat the search).
However, I noticed that this cannot be used when ‘my’ script has been used.
Luckily there is another feature: CMD+E to set the Find string to the current selection.
So I’d need something like:
- Execute my script.
- Simulate CMD+E to set the Find string to the current selection.
- Simulate CMD+G to repeat the search.
I guess that I can achieve this in Keyboard Maestro but I’d be interested to see the AS approach too.
This works for me:
tell application "System Events"
tell process "Skim"
set frontmost to true
click menu item "Use Selection For Find" of menu of menu item "Find" of menu "Edit" of menu bar 1
click menu item "Find Next" of menu of menu item "Find" of menu "Edit" of menu bar 1
activate application "CafeTran"