Apple ID verification script

itsupport's picture

itsupport

Joined: Nov 12, 2014
Your rating: None (1 vote)

I created a script that uses Mail and Safari to automatically verify Apple IDs.

It 'should' work! I've verified a few hundred AppleIDs. I am using it in the UK, so don't know if there are any localization issues.

https://github.com/ntoqiakt/AppleID-Verification-AppleScirpt

Read the instructions first. If you have any issues let me know.

If you find this useful and would like to thank me, you could perhaps get a Copy (dropbox like service) account through my referral link - but you don't have to!

https://copy.com?r=mSjL4L

Top
jerrybutler's picture

jerrybutler

Joined: Sep 17, 2013
WWW

ID verification script

Your rating: None

Thank you for writing this script, it should save hours - but... I formatted my user names all the same - Joe Student. I don't know if this is why the script is breaking - the script fails out when it opens safari, and pastes in https only. I'm wondering if its not able to parse properly and store the url, because my user names e.g. Dear Joe Student, should look like Dear ipad 01, Dear ipad 02 etc? Thoughts?

Top
itsupport's picture

itsupport

Joined: Oct 17, 2014

You will need to tweak this

Your rating: None (1 vote)

You will need to tweak this line to format it to your requirements:


set aidEmail to a & "-" & b & "@" & ourDomain

but if it's failing after opening Safari, it's not the name formatting, it means that it doesn't parse the verification link correctly.

In my verification emails, the links start with "https://id". In the script, I'm looking for that string. The end of the URL in my case (in the UK) ends with en_GB. In the US it's probably en_US? Have a look and see what the correct end of the url is. This is quite possibly one of the problems.

The other thing is that my emails were all encoded as 'QUOTED_PRINTABLE' which was inserting some characters which were breaking the link. The following three lines deal with that:


set theLink to rich text 1 through (endofurl + 5) of theContent
set theLink to replace_chars(theLink, "=3D", "=") of me
set theLink to replace_chars(theLink, "=
", "") of me

The first line just copies the link to the 'theLink' variable.

The seconds line replaces the =3D to just = and the third line is actually:


set theLink to replace_chars(theLink, "=\n", "") of me

but when entered in the Applescript editor the '\n' is replaced with an actual line break. This line basically gets rid of the line breaks and the preceding =.

Put a


display dialog theLink

after the above three lines and see if the URL is formed correctly.

Also, you can put another dialog right before those three lines:


display dialog theContent

to see if the script parses the email correctly.

Alternatively, you could PM me and I'll give you an email address to forward one of the verification emails and I'll try to get it working for you.

Top
jbourdon's picture

jbourdon

Joined: Nov 11, 2014

Is there a reason you went

Your rating: None

Is there a reason you went with the first and last name method instead of getting the email address from the body of the body of the message?

Top
itsupport's picture

itsupport

Joined: Oct 17, 2014

It's because each AppleID has

Your rating: None

It's because each AppleID has a different password (as I was told that each password needed to be a bit different) so I use the 'a' and 'b' parts to make up the AppleID and the password.

So, I set my AppleID emails as

First-Last@domain.com

and my passwords as

First-secretWord-Last

but I guess if use the same pass it doesn't make much sense.

Top
cjackson's picture

cjackson

Joined: Jan 7, 2014
WWW

my spin on a verify script....

Your rating: None

I have also started work on a verification script.
...its nowhere near complete - it would be easier if Apple Script was easier to learn!
It may be that some of the script produced from the script mentioned in this thread might complement this.

So far the script is capable of
- searching through Mail - for unread Emails that need to be verified.
- Extracting the To: (So that you know which user is being verified)
- Extracting the unique URL that is required for processing
- Creating and Displaying the records in a Excel Spreadsheet.

Requirements are for Mail & Excel to be installed and running.

The script so far doesn't actually process the links!

The next step is to get help from you guys or continue to develop as time allows! - So if anyone has any skills?!?!!

Ideally the script would then process through the excel sheet and verify links
My thinking so far is to have this script simply create the links, and produce a further script that would process through the saved sheet.

The script would need to :
- Process through the sheet line by line
- Using the To: cross reference another sheet & copy the password (the one we all use for creating Apple ID's)
...alternatively, it wouldn't be hard to copy passwords from the 'userdata' sheet to the sheet that need to be processed! - either at run time or for another script run etc
- open links to verify using the user /pass from the sheet
- potential flag an error (it would be a big hassle to find out later that an account didn't verify!) / report success
- maybe go back and mark those original emails as read so that they don't get called up again in the future.

Anyway if anyone has some skills and wants to collaborate - feel free to contact me.
cjackson@getitqualified.co.uk

Christian Jackson
@cjacksonuk

Top
jeffreyscholten's picture

jeffreyscholten

Joined: Jan 21, 2014

Great script! Thanks for

Your rating: None

Great script! Thanks for sharing.

Hope someone can help me with the next error:

Mail got an error: Can’t get mailbox "Postvak IN" of account "domain.com".

Top
sthoms105's picture

sthoms105

Joined: Jan 29, 2015

Verification Script for Gmail

Your rating: None
itsupport wrote:

I created a script that uses Mail and Safari to automatically verify Apple IDs.

It 'should' work! I've verified a few hundred AppleIDs. I am using it in the UK, so don't know if there are any localization issues.

https://github.com/ntoqiakt/AppleID-Verification-AppleScirpt

Read the instructions first. If you have any issues let me know.

If you find this useful and would like to thank me, you could perhaps get a Copy (dropbox like service) account through my referral link - but you don't have to!

https://copy.com?r=mSjL4L

Has anybody tried to create a verification applescript for Gmail? We use Gmail and I was able to make a windows script using AutoIT that would pull the usernames and passwords from an excel spreadsheet, then open an incognito window in Chrome and then pull and insert the usernames and passwords into the verification link. Unfortunately this script was really inconsistent and would miss keystrokes and such and I would have to watch it as it went. I have the Batch-Apple-ID applescript working like a charm(thanks for that!) but being able to keep it on one system would be nice.

Top
janeitzey's picture

janeitzey

Joined: Sep 23, 2014

I wasn't able to create

Your rating: None

I wasn't able to create anything in Selenium in Firefox for Gmail. It doesn't pick up in certain things.

Top
afurbee's picture

afurbee

Joined: Oct 31, 2014

This is awesome! I'm

Your rating: None

This is awesome!

I'm currently working on something similar but not using python instead of apple script. So far it's working but still very basic: You give it a username and password and it verifies that one id.

Top
slgsmith's picture

slgsmith

Joined: Mar 3, 2015

Apple ID Verification Script

Your rating: None

Wondering if it is possible for the script to work according to this Verify ID email. Every email has Dear i Centra but each email address and password to verify is different. For example: the email address is icentra604@imail.org the next email will be icentra605@imail.org with a different password. Is there a way to tweak the script to make this work.

Dear i Centra,
You recently selected icentra604@imail.org as your new Apple ID. To verify this email address belongs to you, click the link below and then sign in using your Apple ID and password.
Verify now >

Thank you,
Gordon

Top
jbourdon's picture

jbourdon

Joined: Nov 11, 2014

How is everyone getting the

Your rating: None

How is everyone getting the verification emails into one folder on one account? Making aliases, or doing some domain level email routing?

Top
peterjli's picture

peterjli

Joined: May 22, 2015
WWW

Issues with To field and Verification address

Your rating: None

Hi there,

Thank you so so much for creating this script.

I've made some changes to try and get around the naming conventions by trying to grab the To field value in the email.

I've managed to get it to work for just the first address, but am having the issue of the unique https links for the Apple IDs does not seem to be update with every verification

I'd greatly appreciate any advice/help on getting the proper "To" field in the email and the https link.

This is my edit in bold:
repeat with theMessage in theseMessages

set theContent to source of theMessage
set aidEmail to address of to recipients of thisMessage

set thelist to {} --this will store the URL's

set startofurl to the offset of "https://id" in theContent
set theContent to rich text startofurl through -1 of theContent
set endofurl to offset of "en_GB" in theContent

set theLink to rich text 1 through (endofurl + 5) of theContent
set theLink to replace_chars(theLink, "=3D", "=") of me
set theLink to replace_chars(theLink, "=", "") of me

tell application "Safari"
open location theLink

delay 10

do JavaScript "document.forms['command']['appleId'].value = '" & aidEmail & "'" in document 1
do JavaScript "document.forms['command']['accountPassword'].value = '" & secretWord & "'" in document 1
do JavaScript "document.forms['command'].submit()" in document 1

tell window 1 of application "Safari" to close (tabs where index < (get index of current tab))

end tell
end repeat

Top
jabbajawz's picture

jabbajawz

Joined: Jul 17, 2015

I got it tow work on my MAC

Your rating: None

I normally don't post on these forums, but I thought the info I have could help somebody out.

1. getting all your emails to go to one email box. If you use google then you can add a plus before the @ sign and all the emails will go to that one email box. For example if your email address is example@yourdomain.com, them an email sent to example+1@yourdomain.com and example+2@yourdomain.com etc. will go to example@yourdomain.com. So basically, google ignores everything after the + sign.
If you are an administrator of a non google email box just set up aliases that will go the the one email address. Now just use the aliases for your apple id.

2. Getting gmail to work with this script. You have go into your email settings from gmail and enable IMAP. Once you do that, then configure Apple mail with the "Add Other Account" feature and set up your inbox that way using the gmail imap settings.

3. I got the script to work and it verified a little over 150 apple IDs and then gave me a data error. I must of changed every thing within the script to try and get it to work and about 2 hours of troubleshooting. I restarted the Mac several times and it didn't work. It finally clicked to me that Mail was the culprit. So I deleted the email account and set it back up and it started to run again.

4. The last thing to do is modify the script so that it picks up the email address and your link.
1. Hover over your Verify Account Link to see what it ends with and use the last 5 characters to modify the line item in step 2.
2. Change set endofurl to offset of "en_GB" in theContent to match what is at the end of your link. I changed my to say set endofurl to offset of "en_US" in theContent
3.Change set aidEmail to a & "-" & b & "@" & ourDomain to set aidEmail to address of to recipients of theMessage. Using thisMessage will cause it to enter the same credentials over and over and fail verification except for the first time.
4.If you used the same password for all your apple IDs then modify this line set secretWord to "yourPassword" so that your password is in the quotes. If you used a different password for each, I can't help you with that one.

I am not an AppleScript expert. I only took C++ and .NET for my program classes. It just to time and trial and error for me to figure out what I needed to change to get it to work for me. Hopefully I can help somebody out. Just keep in mind that I am not an expert.

Top
almennn's picture

almennn

Joined: Dec 3, 2014

Exited with a non zero status

Your rating: None

Hi,

Anyone else getting the error

error "Mail got an error: The command exited with a non-zero status." number 1

Keep getting this error, tried on different macs with the same result

Code below, pretty much the original.

set ourDomain to "test.se"
set secretWord to "test"

tell application "Mail"
set selectionMessage to selection -- just select the first message in the folder
set thisMessage to item 1 of selectionMessage
set theseMessages to (every message in (mailbox of thisMessage)) -- if there are no messages selected, warn the user and then quit

if theseMessages is {} then
display dialog "Please select a message first and then run this script." with icon 1
return
end if

repeat with theMessage in theseMessages

-- My emails were formed as follows: ipad-01@domain.com
-- The following code parses the above into two words:
-- Word 'a' is ipad and word 'b' is 01
-- Also, I had set different passwords for each account with the following format: ipad-secretword-01
-- if you have the same password for all of your accounts, set it as the secretWord
-- at the top of this file and leave the script as it is.

set theContent to source of theMessage
set parsedname to do shell script "echo " & (quoted form of theContent) & " | grep 'Dear '"
set a to word 2 of parsedname
set b to word 3 of parsedname

set aidEmail to a & "." & b & "@" & ourDomain
--set aidPassword to secretWord
set aidPassword to secretWord & "@" & a & "&"

set thelist to {} --this will store the URL's

set startofurl to the offset of "https://id" in theContent
set theContent to rich text startofurl through -1 of theContent
set endofurl to offset of "en_GB" in theContent

-- the following 3 lines of code just clean up the link as it was getting
-- some funny characters because it was encoded as QUOTED PRINTABLE
set theLink to rich text 1 through (endofurl + 5) of theContent
set theLink to replace_chars(theLink, "=3D", "=") of me
set theLink to replace_chars(theLink, "=
", "") of me

tell application "Safari"
open location theLink

delay 7

do JavaScript "document.forms['command']['appleId'].value = '" & aidEmail & "'" in document 1
do JavaScript "document.forms['command']['accountPassword'].value = '" & aidPassword & "'" in document 1
do JavaScript "document.forms['command'].submit()" in document 1

end tell
end repeat
end tell

on replace_chars(this_text, search_string, replacement_string)
set AppleScript's text item delimiters to the search_string
set the item_list to every text item of this_text
set AppleScript's text item delimiters to the replacement_string
set this_text to the item_list as string
set AppleScript's text item delimiters to ""
return this_text
end replace_chars

Please help!

Top
almennn's picture

almennn

Joined: Dec 3, 2014

Found the problem

Your rating: None

The issue was that the script couldn't pick up (grep) the information from the source of the message because it was a forwarded mail and that messed up the source! Smile

Top
sojka's picture

sojka

Joined: Oct 12, 2014

Apple ID verification script

Your rating: None

Hi,
I am new for Apple ID Creating Script.
I was able to run Batch Apple ID Creator for my school (about 3000)
I like to know how to run Apple ID verification script with Gmail.
Did anybody have some good tutorial on how to run Apple ID verification script with Gmail.
I will really appreciate.
Thank you! Smile

Top
acemary's picture

APPLE ID

Your rating: None

I am attempting to use by Apple ID mail account (iCloud) to send mail using SMTP from a remote FileMaker Server. This consistently results in an "Authentication Failed" response. My Apple ID is protected by two factor authentication. I have tried all other known workarounds. My Gmail account fails as well now that tow factor authentication is enabled.
Any thoughts would be appreciated.

Top
jms164's picture

jms164

Joined: Apr 24, 2016

latest and greatest

Your rating: None

what is the latest and greatest applescript that works with Itunes 12.3.3.17 to create batches of 100+ appleids???

Top
jacobanthony's picture

APPLE ID

Your rating: None

So - I finally bit the bullet yesterday and put Lion, via a clean install, onto my MBP. The iMac is still on SL but will probably make the transition soon if I continue to be pleased with Lion - which so far, I am. (Moving to Lion fixed that Safari graphics glitch I had posted about previously)

The primary catalyst that caused me to finally update was iCloud. I picked up my iPhone 4S 2 days ago - and was having absolutely zero luck getting iCloud to verify my Apple ID. It just kept telling me it sent a verification e-mail - but it never did. All iCloud options remained greyed out and inaccessible.

I scoured the internet - and quickly found out that I wasn't the only one experiencing this - and there were any number of posted solutions - but none of them either applied or worked for me.

After literally trying everything from changing my password - resetting notifications to trying my me.com ID, trying to manage my Apple ID via the Apple website and get the verification e-mail sent from there, etc etc - I tried one last thing. I was hesitant to do this - because I didn't know if it would end badly meaning - I'd lose my purchases - but all was good.

Basically all I did was go to - My Apple ID Clicked Manage my account - used the Apple ID in question - my primary ID - logged in - and as usual it just says that it has sent a verification e-mail and is waiting. There's a big blue button that says resent verification e-mail - but it too - does nothing. Web Designing Training in Chennai Smile

Click edit (next to your AppleID) and enter a new e-mail address - basically you're changing the e-mail associated with your AppleID - and ultimately - your Apple ID. Walk through that process and this time it WILL send a verification e-mail! Yay! Click the link in the e-mail to verify - and boom - instantaneous iCloud connectivity. Of course - you now have to go to all your devices and enter the new information - but it's really not that big of a deal. Web Designing Training in Chennai Smile

I'd imagine that you could go back through the same process - and change it back to your original - but in my case - I was satisfied to use the new one. Web Designing Training in Chennai Smile

Hopefully this is helpful to anyone banging their head against the wall as I was.

Top
feroj's picture

feroj

Joined: May 15, 2016

verification script

Your rating: None

[quote=itsupport................

boss i don't understand how to processing the script file. how to run. can you help me for some detail.? i am using os windows 7 and itune. how to create some apple id. please help me.

Top

Who is online?

There are currently 0 admins, 0 users and 8 guests online. Connected users: .

Recent Activity