• 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
gui scripting - paste script not working
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gui scripting - paste script not working


  • Subject: gui scripting - paste script not working
  • From: Vince Angeloni <email@hidden>
  • Date: Sun, 08 Jun 2008 10:18:41 -0500

Hi,

This script will copy the data to the clipboard, but the GUI scripting part does not seem to be working. I run it as an application and it runs but does not paste the clipboard into the frontmost application. The info _is_ in the clipboard as I can paste it in manually after the script runs. Any clues as to why the GUI scripting part isn't working?

Thanks

vince


------------
set myName to "John Q. Public"
set myStreet to "123 Main St."
set myCity to "Anywhere"
set myState to "PA"
set myZip to "18452"
set mydivider to "=============" & return
set myURL to "http://www.myurl.com"
set myemail to "email@hidden"

set Paste_content to myName & return & myStreet & return & myCity & ", " & myState & " " & myZip & return & mydivider & myURL & return & myemail


set frontApp to getfrontmostappname()
tell application frontApp
activate
set the clipboard to Paste_content
tell application "System Events"
tell process frontApp
keystroke "v" using {command down}
end tell
end tell


end tell
--returns the name of the current frontmost application
on getfrontmostappname()
tell application "System Events"
set frontmostapps to every application process whose frontmost is true
set frontmostappname to name of item 1 of frontmostapps
end tell
return frontmostappname
end getfrontmostappname

 _______________________________________________
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

  • Follow-Ups:
    • Re: gui scripting - paste script not working
      • From: KOENIG Yvan <email@hidden>
    • Re: gui scripting - paste script not working
      • From: deivy petrescu <email@hidden>
  • Prev by Date: Re: Getting recurring event instance for specific day in iCal
  • Next by Date: Re: gui scripting - paste script not working
  • Previous by thread: Re: Text as list
  • Next by thread: Re: gui scripting - paste script not working
  • Index(es):
    • Date
    • Thread