Apple-ID-AppleScript icon indicating copy to clipboard operation
Apple-ID-AppleScript copied to clipboard

Time out issue and mouse movement

Open jploughe opened this issue 9 years ago • 11 comments

When I run the script to create ID's, I have to keep moving the mouse every few seconds or the process times out. It started on Friday (12/4/15) when I tried to create a batch of 50 ID's. It started after the 6th ID. at first I thought it was an issue with Apple's site. I restarted the script with ID#7 and it timed out again after 6 more ID's. After 23 ID's, I gave up for the day. (yes, I did have Apple whitelist my IP address). This morning, I tried it again and it would time out before finishing 1 ID. I rebooted machine and tried again. After it timed out again, I noticed that when I moved the mouse, iTunes would suddenly move to the next screen. I tried again and found that if I didn't physically move the mouse every 10-15 seconds, it would stall until I moved it again. If I kept mouse moving, it would fly though the creation process.

jploughe avatar Dec 07 '15 14:12 jploughe

This is a limitation Apple added a while ago and I've been trying to find a solution. So far the closest I've gotten is clicking the apple logo but that still doesn't work all the time.

I'm still searching for a solution

ghost avatar Dec 07 '15 14:12 ghost

New twist. Now if i don't keep the mouse in motion, they have a bogus message popping up telling me it can't communicate with iTunes Store and to check my firewall settings for port 443. If I click OK fast enough script will continue.

jploughe avatar Dec 08 '15 17:12 jploughe

That... Is not something I've seen before. Having never seen this myself I'm not sure how to counteract this

Sent from my iPhone

On Dec 8, 2015, at 09:48, jploughe [email protected] wrote:

New twist. Now if i don't keep the mouse in motion, they have a bogus message popping up telling me it can't communicate with iTunes Store and to check my firewall settings for port 443. If I click OK fast enough script will continue.

— Reply to this email directly or view it on GitHub https://github.com/brandonusher/Apple-ID-AppleScript/issues/39#issuecomment-162959193 .

ghost avatar Dec 08 '15 17:12 ghost

I will try to get a screen shot for you

jploughe avatar Dec 08 '15 17:12 jploughe

tried again and it let me finish the last 10 ID's I was making without the popup. I only moved mouse until it got to last page before it says it sent verification email.

jploughe avatar Dec 08 '15 18:12 jploughe

After generating around 100 ID's today, I've started to get a "Your session has timed out" message. Talked to our Apple Solution Engineer and tried resetting iTunes Cache with no luck. He's reaching out to one of the engineering teams to see what they say. One of the machines seemed to be back after about an hour. When I started up the script again it got half way through the first Apple ID and gave the same timeout error. Has anyone else run into this issue?

JRHutson avatar Feb 10 '16 00:02 JRHutson

@JRHutson I have seen this as well. The only thing that has fixed it for me is creating a new user on the computer or using a new computer all together. Anything short of that and it won't work.

I've tried deleting everything iTunes related (Cache, actual files/folders called iTunes and the users cache folder) and I've not had any luck. It may fix it for 2 Apple ID's but after that it comes right back

ghost avatar Feb 10 '16 03:02 ghost

@brandonusher That's a nusance, but if it fixes the issue it will be a godsend. Do you just set up a new user when you start a big batch in anticipation?

JRHutson avatar Feb 10 '16 05:02 JRHutson

Pretty much. Or just image a computer clean and use it again.

Come to think of it, if you have Virtual Box or something you could create a snapshot of a machine before you even create any Apple ID's and restore the snapshot before every batch.

Also, sorry for the duplicate notification. Accidentally got my personal projects account thrown in to the mix of replying to you.

ghost avatar Feb 10 '16 06:02 ghost

@brandonusher Can you give me permission to create a branch? I was going to add a note about this to the Read Me.

JRHutson avatar Feb 17 '16 16:02 JRHutson

Try using the with timeout clause. (The snippet below is from Hanaan Rosenthal's excellent Learn AppleScript book.)

The following script lets the user choose a file. It will allow the dialog box to remain open for one hour before automatically exiting the script. The problem is that even after the choose file command times out and causes the script to stop, the Choose File dialog box still displays. To deal with this issue, the script uses a try block to trap the timeout error (error –1712) and uses GUI scripting to gracefully dismiss the dialog box.

try
    with timeout of (1 * hours) seconds
        tell application "Finder"
            set the_alias to choose file with prompt "Select a file to process:"
        end tell
    end timeout
on error number -1712 -- The command timed out, so cancel the script
    tell application "System Events"
        tell application process "Finder"
            click button "Cancel" of window "Choose a File"
        end tell
    end tell
    error number -128 -- Throw a "User canceled" error
end try

ghost avatar Aug 31 '16 18:08 ghost