• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: With Yosemite, can no longer get selected text of Google Chrome page
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: With Yosemite, can no longer get selected text of Google Chrome page


  • Subject: Re: With Yosemite, can no longer get selected text of Google Chrome page
  • From: Yvan KOENIG <email@hidden>
  • Date: Sun, 26 Oct 2014 19:36:46 +0100

I use this script to copy the selected text in a Safari page.


set textSelected to my safeCopy("Safari")


#=====

on safeCopy(theApp)
local tt
(*
Fill the clipboard with a fake string *)
set tt to "All The Things You Could Be By Now If Sigmund Freud’s Wife Was Your Mother, © Charles Mingus"
set the clipboard to tt
activate application theApp
delay 0.1 # required with Yosemite
tell application "System Events" to tell process theApp
keystroke "c" using {command down}
end tell


(*
Loop waiting the achievement of the Copy task. *)
repeat 10 times
try
delay 0.2
if (the clipboard as text) is not tt then exit repeat
end try
end repeat
end safeCopy

#=====

Check that it works for you then, if it does (as I guess), replace "Safari" by the name of the Google Chrome application.

Yvan KOENIG (VALLAURIS, France) dimanche 26 octobre 2014 19:36:30


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

References: 
 >With Yosemite, can no longer get selected text of Google Chrome page (From: Charles Arthur <email@hidden>)

  • Prev by Date: With Yosemite, can no longer get selected text of Google Chrome page
  • Next by Date: Re: dock position
  • Previous by thread: With Yosemite, can no longer get selected text of Google Chrome page
  • Next by thread: Re: With Yosemite, can no longer get selected text of Google Chrome page
  • Index(es):
    • Date
    • Thread