Tell launch issue


hi,

i'm trying create applescript runs application. when run, prompts user number of hours, waits number of hours launch specific application, instance, textedit.

reason (i think since yosemite), each first time open or compile in applescript, or application once saved, starts target application immediately, before it's prompted user. process repeats if applescript closed down , opened again. never used prior yosemite, seemed start of sudden.

code follows:

code:
  set x text returned of (display dialog "open textedit in {x} hours?" title "input value..." default answer "0" buttons {"cancel", "start"} default button 2)  set y x  set x (x * 60) * 60  if x > 0  	set mydate current date  	set mynewdate mydate + (y * hours)  	set mytime time string of mynewdate  	set myparts words of mytime  	set mydisplay (item 1 of myparts) & ":" & (item 2 of myparts)  	display dialog "textedit start @ " & mydisplay title "starting at..." buttons {"cancel", "confirm"} default button 2  	display notification "starting textedit @ " & mydisplay  	set input x  	delay input  	tell application "textedit" launch  else  	display dialog "cannot 0 or null." title "error..." icon stop buttons {"ok"} default button 1  end if  
i've tried using block tell/end tell , using activate rather launch same thing happening. i've tried using sub-routine same result. if comment out tell statement, problem naturally doesn't occur.

want application launch once user has submitted input , assumed if statement not execute until done. can advise if/where going wrong? i'm aware code may messy, , there better ways things, i've not got lot of experience applescript.

in advance help.
 

you can try :

code:
launch application "textedit"  --or  shell script "open -a /applications/textedit.app"  
 


Forums Macs Mac Programming


  • iPhone
  • Mac OS & System Software
  • iPad
  • Apple Watch
  • Notebooks
  • iTunes
  • Apple ID
  • iCloud
  • Desktop Computers
  • Apple Music
  • Professional Applications
  • iPod
  • iWork
  • Apple TV
  • iLife
  • Wireless

Comments

Popular posts from this blog

Pasco WA. Cops Killing A Homeless Man while running away

Gold Apple Watch Buyers to Get Special Purchasing Experience With 30 Minute Appointments

Transferring URLS