Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

TheMTtakeover

macrumors 6502
Original poster
Aug 3, 2011
470
7
Okay the script is:

Code:
tell application "SkyDrive"
	quit
end tell
set the_button to button returned of (display dialog "Did Skydrive close?" buttons {"Yes", "No"} default button 1)
if the_button is "Yes" then tell application "Terminal"
	activate
	do script "cp -av /Users/osx/Desktop/test /Users/osx/Desktop/untitled folder"
end tell
if the_button is "No" then display dialog "Please Try Again"
delay 2
set button_two to button returned of (display dialog "Was the copy successful?" buttons {"Yes", "No"} default button 1)
if button_two is "Yes" then tell application "SkyDrive"
	activate
end tell
if button_two is "No" then display dialog "Please Try Again"

It works fine until when I hit yes that the copy was successful.SkyDrive doesn't start and an error pops up, but then after the error pops up SkyDrive starts. So it has me kind of puzzled because it does work but it just needs the error to pop up first?

the error is:
error "SkyDrive got an error: AppleEvent timed out." number -1712

Any help would be greatly appreciated!
 
Last edited:

wrldwzrd89

macrumors G5
Jun 6, 2003
12,110
77
Solon, OH
Okay the script is:

Code:
tell application "SkyDrive"
	quit
end tell
set the_button to button returned of (display dialog "Did Skydrive close?" buttons {"Yes", "No"} default button 1)
if the_button is "Yes" then tell application "Terminal"
	activate
	do script "cp -av /Users/osx/Desktop/test /Users/osx/Desktop/untitled folder"
end tell
if the_button is "No" then display dialog "Please Try Again"
delay 2
set button_two to button returned of (display dialog "Was the copy successful?" buttons {"Yes", "No"} default button 1)
if button_two is "Yes" then tell application "SkyDrive"
	activate
end tell
if button_two is "No" then display dialog "Please Try Again"

It works fine until when I hit yes that the copy was successful.SkyDrive doesn't start and an error pops up, but then after the error pops up SkyDrive starts. So it has me kind of puzzled because it does work but it just needs the error to pop up first?

the error is:
error "SkyDrive got an error: AppleEvent timed out." number -1712

Any help would be greatly appreciated!
The problem may be that SkyDrive is taking longer than AppleScript is willing to wait for it. If that's the case, you could fiddle with the time out value - but I have no idea how you set that globally, only for dialog boxes.
 

TheMTtakeover

macrumors 6502
Original poster
Aug 3, 2011
470
7
The problem may be that SkyDrive is taking longer than AppleScript is willing to wait for it. If that's the case, you could fiddle with the time out value - but I have no idea how you set that globally, only for dialog boxes.

Thats what I thought so I changed the code:

Code:
if button_two is "Yes" then with timeout of 10 seconds
	tell application "SkyDrive"
		activate
	end tell
end timeout
and no matter how many seconds I set the timeout for SkyDrive won't reopen until the error message pops up. I cannot figure this thing out at all
 

TheMTtakeover

macrumors 6502
Original poster
Aug 3, 2011
470
7
If anybody comes across this having the same problem the only workaround I was able to find was running it through the terminal so it would end up being
Code:
tell application "SkyDrive"
	quit
end tell
set button_one to button returned of (display dialog "Did Skydrive close?" buttons {"Yes", "No"} default button 1)
if button_one is "Yes" then tell application "Terminal"
	activate
	do script "cp -av /Users/osx/SkyDrive /Volumes/Skydrive/$(date +%Y-%m-%d)"
end tell
if button_one is "No" then error number -128
set button_two to button returned of (display dialog "Was the copy successful?" buttons {"Yes", "No"} default button 1)
if button_two is "Yes" then tell application "Terminal"
	do script "open -a SkyDrive"
end tell
if button_two is "No" then error number -128
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.