Hello,
I have zero coding skill, but thanks to help in the past have constructed an outline of code, which is intended to help with what I would like to achieve, uses some base code that works, and other parts that need someone with real coding skills to complete, and add the missing sauce.
Using Twitter Scripter I have been able to successfully tweet, and also tweet with an image! This led to the idea of using a droplet to drop images onto when on location which would automatically tweet to an account or accounts, which we have setup on our MacMini for the image placed in the specified folder.
Expanding this further, we had the idea of using multiple accounts from the team to maximise coverage using the same image, but with different tweets for the account used.
I do not know how to setup the code below to work. This includes the way to attach the account defined to work with Twitter with the related tweets, how to enable or disable the droplet, how to setup to run with one, two or all accounts, and how to set the image path to not require the name of the image to work, as it should only run with the image dropped onto the application.
In addition, I would like to send an iMessage once the tweet(s) have been sent. This could simply state that a tweet has been sent, but would be great if it could include the actual tweet from the account or accounts used.
Below is the code I have created so far with comments around the missing elements or parts that I have not been able to complete!
Thank you all in advance.
Tweets will post the same image associated with this script, and then post to the account specified with the tweet(s) allocated to the associated account.
Is it possible to check if Twitter is alive first? This is not essential but a nice to have. No code added, as don’t know where to start on this!
This scrip will be using Twitter Scripter, which works with the Twitter Accounts defined in the Mail, Contacts & Calendars System Preference in Mac OS 10.8
http://mousedown.net/mouseware/TwitterScripter.html for more details and download of current version from Mousedown
http://mousedown.net/mouseware/TwitterScripter_Examples.html for examples
property enableTwitter : true
true use twitter
false disable using twitter
– I would like the ability to enable of disable use of the code. Don’t know what to add for this to work!
property enableAccounts : 0
0 = use the primary account only
1 = use for primary and secondary account
2 = use for enabling all three accounts
– No idea how to code the above into the rest of the script!
property myTwitterAccount1 : “” # used for primary Twitter account. This is the account name setup in the system e.g. @FredBlogs
property myTwitterAccount2 : “” # used for second Twitter account
property myTwitterAccount3 : “” # used for third Twitter account
– Each Twitter account must be enabled to work! If not enabled no tweets for the disabled account will be sent!
property theHashTags : {“#Tag1, #Tag2”}
– These will be added to every post and account where included. Used for Twitter walls where a key tag is required
– Need a way to enable or disable multiple Twitter accounts. Default is Primary account if enabled. Second and Third account will fail gracefully if turned on with no tweets. For example no error message and the script continues processing.
property theTweetsAccount1 : {“Tweet 1”, “Tweets 2”, “Tweet 3”, “Tweet 4”}
– Edit it to fit needs for Twitter Account 1. Each tweet will appear sequentially until reaching the end, and will then start from Tweet 1
property currentTweetsIndex1 : 1
– Associated to Twitter Account 1
property theTweetsAccount2 : {“Tweet 1”, “Tweets 2”, “Tweet 3”, “Tweet 4”}
– Edit it to fit needs for Twitter Account 2. Each tweet will appear sequentially until reaching the end, and will then start from Tweet 1
property currentTweetsIndex2 : 1
– Associated to Twitter Account 2
property theTweetsAccount3 : {“Tweet 1”, “Tweets 2”, “Tweet 3”, “Tweet 4”}
– Edit it to fit needs for Twitter Account 3. Each tweet will appear sequentially until reaching the end, and will then start from Tweet 1
property currentTweetsIndex3 : 1
– Associated to Twitter Account 3
END Tweeting setup
Tweeting from here
Tweet sending a picture. Note that for security pictures must be sourced from within the Pictures folder in your home folder
tell application “Twitter Scripter”
-- The following code needs to send the same image to each enabled Twitter account, and use the tweets associated with each account if enabled, or only the primary account if only one account is setup.
set imagePath to "HARD Disk X:Users:USERNAME:Pictures:TweetImages:test.jpg" # needs to work with any image dropped onto the application
-- Have not been able to make the code work with an image unless the full name is specified i.e. Test.jpg!
tweet "Tweet testing" using account "MyTwitterAccount1" with image imagePath #Default account if Tweets are enabled
tell me to delay 20
tweet "Tweet from theTweets2 & TheHasTag" using account "MyTwitterAccount2" with image imagePath # Second account if enabled
tell me to delay 30
tweet "Tweet from theTweets3 & TheHasTag" using account "MyTwitterAccount3" with image imagePath # Third account tweets if enabled
end tell
tell me to delay 20 # used before sending an iMessage to confirm tweet sent
iMessage notifications
– Code here to send an iMessage with tweet details associated with the enabled account or accounts