• 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: Script Menu or FastScript and paste
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Script Menu or FastScript and paste


  • Subject: Re: Script Menu or FastScript and paste
  • From: Yvan KOENIG <email@hidden>
  • Date: Mon, 03 Aug 2015 14:47:18 +0200

In fact I no longer need to trigger the clipboard : 
--{code}

on run
my germaine()
end run

on germaine()


tell application "System Events" -- get frontmost process
set frontmostProcess to first process where it is frontmost -- this will be the script process
if name of frontmostProcess is in {"Script Editor", "AppleScript Editor"} then
set visible of frontmostProcess to false -- hide the script process
repeat while (frontmostProcess is frontmost) -- wait until the script is hidden
delay 0.1
end repeat
set theApp to name of first process where it is frontmost -- get name of frontmost process (ignoring the script process)
set frontmost of frontmostProcess to true -- unhide the script process
else
set theApp to name of frontmostProcess
end if
end tell


set theDate to current date


set leMessage to "Yvan KOENIG running Yosemite 10.10.4 in French (VALLAURIS, France) " & date string of theDate & space & time string of theDate
if month of theDate as number is 8 then
set leMessage to my remplace(leMessage, "û", "^u")
end if


tell application "System Events" to tell process theApp
set frontmost to true
keystroke return & leMessage & return
end tell


end germaine

#=====
(*
replaces every occurences of d1 by d2 in the text t
*)
on remplace(t, d1, d2)
local oTIDs, l
set {oTIDs, AppleScript's text item delimiters} to {AppleScript's text item delimiters, d1}
set l to text items of t
set AppleScript's text item delimiters to d2
set t to l as text
set AppleScript's text item delimiters to oTIDs
return t
end remplace

#=====

does exactly what I need.


Yvan KOENIG running Yosemite 10.10.4 in French (VALLAURIS, France) lundi 3 août 2015 14:46:44



 _______________________________________________
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: Script Menu or FastScript and paste
      • From: Yvan KOENIG <email@hidden>
References: 
 >Script Menu or FastScript and paste (From: Yvan KOENIG <email@hidden>)
 >Re: Script Menu or FastScript and paste (From: Shane Stanley <email@hidden>)
 >Re: Script Menu or FastScript and paste (From: Yvan KOENIG <email@hidden>)

  • Prev by Date: Re: Script Menu or FastScript and paste
  • Next by Date: Re: Script Menu or FastScript and paste
  • Previous by thread: Re: Script Menu or FastScript and paste
  • Next by thread: Re: Script Menu or FastScript and paste
  • Index(es):
    • Date
    • Thread