Rules and scripting

Does iChat support "rules" the way that mail does? Can iChat parse contents of messages or run scripts? Alternately, does Adium support that, or would anyone recommend another chat application?
I'm trying to run scripts on my computer from my phone using AIM.

I found my own answer buried in iChat. Their scripts directory has a script on parsing IM's:
using terms from application "iChat"
-- Basic "Current track" message to use as a default response message.
on getCurrentiTunesTrack()
-- start with "not playing," just in case.
set theCurrentTrackMessage to "Not playing."
tell application "iTunes"
if player state is playing then
-- response to "status" message is of the form "Now playing "<Song>" by <Artist>"
set theCurrentTrackMessage to "Now playing \"" & (name of current track) & "\""
-- if artist is missing, use track title only.
if (artist of the current track) is not missing value then
set theCurrentTrackMessage to theCurrentTrackMessage & " by " & (artist of the current track)
end if
-- add a message if the volume is muted
if mute then
set theCurrentTrackMessage to theCurrentTrackMessage & " (muted)"
end if
end if
end tell
return theCurrentTrackMessage
end getCurrentiTunesTrack
-- handler to respond to all incoming messages.
on runiTunesRemoteControl(theMessage)
-- use default "unknown" command, just in case.
set theResponse to "Unknown command."
if theMessage is "status" then
-- "status" command displays current track
set theResponse to getCurrentiTunesTrack()
else if theMessage is "next" then
-- "next" command moves to next track.
tell application "iTunes"
next track
end tell
-- set the response message and add the status.
set theResponse to "Playing next track. " & getCurrentiTunesTrack()
else if theMessage is "previous" then
-- "previous" track moves to previous track.
tell application "iTunes"
previous track
end tell
set theResponse to "Playing previous track. " & getCurrentiTunesTrack()
else if theMessage is "mute" then
-- "mute" turns the volume off.
tell application "iTunes"
set mute to true
end tell
set theResponse to "iTunes muted. " & getCurrentiTunesTrack()
else if theMessage is "unmute" then
-- "unmute" turns the volume on.
tell application "iTunes"
set mute to false
end tell
set theResponse to "iTunes unmuted. " & getCurrentiTunesTrack()
else if theMessage is "play" then
-- "play" tells iTunes to start playing.
tell application "iTunes"
play
end tell
set theResponse to getCurrentiTunesTrack()
else if theMessage is "pause" then
-- "pause" pauses the current track.
tell application "iTunes"
pause
end tell
set theResponse to "Paused. " & getCurrentiTunesTrack()
else if theMessage is "help" then
-- display available commands on "help"
set theResponse to "Available commands: status, next, previous, mute, unmute, help, play, pause"
end if
return theResponse
end runiTunesRemoteControl
-- When first message is received, accept the invitation and send a greeting message from iTunes Remote Control.
on received text invitation theMessage from theBuddy for theChat
accept theChat
send "Welcome to iTunes Remote Control. " & runiTunesRemoteControl("help") to theChat
end received text invitation
-- On subsequent messages, pass the message directly to iTunes Remote Control.
on message received theMessage from theBuddy for theChat
-- run the iTunesRemoteControl parser.
set theResponse to runiTunesRemoteControl(theMessage)
-- send back the response.
send theResponse to theChat
end message received
-- Sample, so you can test run this through Script Editor.
display dialog "Send a command to iTunes Remote Control:" default answer "status"
set theMessage to the text returned of the result
set theResponse to runiTunesRemoteControl(theMessage)
display dialog theResponse
end using terms from

Similar Messages

  • Script to change the priorty of all rules and monitors in a Management Pack

    Script to change the priority and severity  of all rules and monitors in a Management Pack in an override MP .We are deploying an MP in production and don't want the helpdesk to take any action on any alerts, so want to set all of them as informational.Once
    they are reviewed then we will delete that override mp
    Can some one help me with a script
     

    Is this MP sealed?  Doesn't really matter..  Unseal the MP if it is sealed.  Now you have access to the RAW XML.  Alert severity and priority have xml tags.  You should be able to do a search and replace and change all the various
    levels (0-3 or whatever they are) to the levels and priority you want.
    Then you can seal the mp with your own key, or just roll it into prod as an unsealed MP.
    This seems, to me, like the quickest and easiest way to make all of these changes at once.  To bulk override everything, not even sure it's still around or even works, there was a tool called Override Explorer, and you could select multiple monitors/events
    and create overrides.  I can't remember very much about the tool because we didn't use it much, but I think it did this with live data, meaning it connected to your management server, and you made the changes in real time.  
    Of course you wouldn't want to do this in production, so do it in a lab, then export the override mp and put it in prod.
    There is probably some snazzy way to do this with PoSh, but I am not aware of any atm.
    Regards, Blake Email: mengotto<at>hotmail.com Blog: http://discussitnow.wordpress.com/ If my response was helpful, please mark it as so, if it answered your question, then please also mark it accordingly. Thank you.

  • Calc script, Business rule and business rule macro

    Hi John,
    Can we use calc script , BR sequence and a BR macro against different databases at a single go.
    In one calc script or BR sequence or BR macro itself can i calculate 2 databases

    If possible could you not start every post with my name, there are lots of others helping on this forum and they provide excellent answers
    Calc Scripts run against one database.
    Sequences can contain multiple business rules, in the launch variables you can set the database to run against for each rule (outside of the planning application though)
    Macros are called from a business rule and are run against the database the calling rule is being run against.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • Rule or script to delete specific attachments in Mail?

    Some people send signature images with every email, wasting disk space and making it difficult to search for emails with useful attachments.
    I would like to have a rule or script that deletes PointlessLogo.gif from incoming mail, while leaving other attachments intact.
    A search of the archives turns up a thread from years ago asking the same thing, apparently it was not possible with OS 10.4 (https://discussions.apple.com/message/4133181#4133181).
    Does this capability exist in Mountain Lion?

    Some people send signature images with every email, wasting disk space and making it difficult to search for emails with useful attachments.
    I would like to have a rule or script that deletes PointlessLogo.gif from incoming mail, while leaving other attachments intact.
    A search of the archives turns up a thread from years ago asking the same thing, apparently it was not possible with OS 10.4 (https://discussions.apple.com/message/4133181#4133181).
    Does this capability exist in Mountain Lion?

  • Mail Rule calls script

    I am setting out to create an AppleScript that will make some changes to messages as identified in a rule. So I took the Sample as supplied in /Library/Scripts/Mail Scripts/Rule Actions and modified it for the first test. Result was not successful and then Mail crashed.
    So I took the original Sample script and set that to run from the rule and ran Rules against half a dozen messages. According to this Sample script, I should have seen a dialog for each message with some info in it from that message. The first dialog looked ok but matched a message that was already in the Trash and hence not selected for the test, the second dialog was blank and then Mail crashed.
    I've tried with various selections of messages and Mail almost always crashes.
    Is there something I should know about as to why Apple's own Sample script fails so spectacularly?

    Well, as I said it was the supplied sample rule action script in /Library/Scripts/Mail Scripts/Rule Actions and actually entitled Sample Rule Action Script.scpt, but here is the actual script:-
    using terms from application "Mail"
    on perform mail action with messages theMessages for rule theRule
    tell application "Mail"
    set theText to "This AppleScript is intended to be used as an AppleScript rule action, but is also an example of how to write scripts that act on a selection of messages or mailboxes." & return & return & "To view this script, hold down the option key and select it again from the Scripts menu."
    repeat with eachMessage in theMessages
    set theSubject to subject of eachMessage
    try
    -- If this is not being executed as a rule action,
    -- getting the name of theRule variable will fail.
    set theRuleName to name of theRule
    set theText to "The rule named '" & theRuleName & "' matched this message:"
    set theText to theText & return & return & "Subject: " & theSubject
    display dialog theText
    set theText to ""
    end try
    end repeat
    if theText is not equal to "" then
    display dialog theText buttons {"OK"} default button 1
    end if
    end tell
    end perform mail action with messages
    end using terms from
    The above is a direct copy from the script (indentation lost though of course), as supplied by Apple as an example of the way to write
    rule action scripts.
    I tested with a copy of a rule that had already moved a dozen messages into a specific mailbox which was now open in Mail, so I could see those messages. I modified the copy to run the script instead of moving messages and then stop processing the rules and placed it at the top of the rule list so it would be the one and only rule to run. I then selected one or more messages in the mailbox and selected 'Apply Rules', either from the Message or contextual menu and I once saw the dialog with the subject line of a message that had already been moved to the Trash, then it was blank, then it crashed, but mostly there's just several seconds delay without anything happening before Mail simply crashes, i.e. terminates unexpectedly. It restarts ok without complaint, but will do it again as soon as I 'Apply' the rules again.
    I guess I'm particularly peeved that Apple's own sample/guide, call it what you want seems to be so obviously flawed. Or am I missing something?

  • Planning ,Business rules and Reporting Analysis Backup

    Hi
    Currently we have migrated our Hyperion Planning EPMA 11.1.1.2 applications from TEST to PROD on windows 2003 Server (2 boxes).Essbase Server on UNIX and Application Server is OAS.We need to take backups on daily basis for Hyperion planning, BR's ,Reporting Analysis , Financial Reporting and Essbase , Open LDAP.
    But now We are taking only backups for Essbase and Open LDAP by using maxl script and Backup.bat file (Scheduled in Windows Scheduler)
    As per the documentation we are going to take the backups for the Hyperion planning, BR's ,Reporting Analysis , Financial Reporting also.
    Our concerns are
    1)Is there any BAT files for planning , BR'S and Reporting like open LDAP Backup.BAT
    2) If doesn't have how can we move ?(not manually, Using Windows Scheduler)
    3) Is there any necessity to create new Batch scripts for this action?
    Could you please any one help me out.
    Thanks in advance

    Hi,
    There are no other batch scripts I am aware of, you will have to create any new ones.
    In regards to backing up with business rules and planning, that would be mainly be backing up the repository.
    You can also use LCM to export your objects and this can be called from command line.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • How to remove Catalyst stylesheets and scripts

    How do I stop BC from inserting stylesheets and scripts into my layouts? I have been working on catalog and product layouts and templates but BC continues to insert scripts & stylesheets that I do not want to include, particularly borders and margins.
    I know about removing all code leaving it blank from the /StyleSheets/ModuleStyleSheets.css
    But here is an example of a product large which includes a number of these which effect the layout
    <link href="/StyleSheets/ModuleStyleSheets.css" type="text/css" rel="StyleSheet" />
    <script type="text/javascript">var jslang='EN';</script>
    <link rel="stylesheet" href="/CatalystStyles/Box.css" type="text/css" media="screen" />
    <script type="text/javascript" src="/CatalystScripts/Java_OnlineShopping.js"></script>
    <script type="text/javascript" src="/CatalystScripts/Java_Cookies.js"></script>
    <script type="text/javascript" src="/CatalystScripts/Java_Box.js"></script>
    Any suggestions would be greatly appreciated

    While I don't recommend using the Cloud Service you are talking about to speed up the site (you can just combine and minify your styles and scripts for faster performance instead) I think your best bet is to copy the contents of ModuleStylesheets.css above the CSS rules in your main CSS file that styles your site.  Then, delete all the CSS rules in ModuleStylesheets.css so that it's an empty file.  BC will still render the ModuleStylesheets reference in the HEAD above your script but it will only be quick connection to the server to return 0kb (an empty file). 
    Since you moved your modulestylesheet css to your main css file (and it's referenced after the Cloud Service script) then you should be good to go.
    Again, though I recommend not using that cloud service and just combine all your CSS and scripts into two files, one for all your CSS and one for all your js and then making sure all your images are optimized on the site and where there are instances of images that have a fixed width and height you can utilize sprite sheets so that a lot of your images are stored in a single image.
    Another option is to pay for the super cheap Amazon S3 and upload your main css file and your single minified and combined javascript files to there and update your page template to reference the CSS and JS on Amazon S3 so it's essentially like a CDN which will speed things up as well.

  • Rules and Alerts Issue

    Hi,
    I'm trying to create a rule to forward an email and change the subject line.  The forward rule has been created but within that same rule I'm unable to specific "a new subject heading".  Has anyone had success with this?

    You'll need to use Run a script. Try this one: 
    http://www.slipstick.com/outlook/rules/run-script-rule-change-subject-message/
    Diane Poremsky [MVP - Outlook]
    Outlook & Exchange Solutions Center
    Outlook Tips
    Subscribe to Exchange Messaging Outlook weekly newsletter

  • Troubles with rule action scripting, again

    I'm baaack, I have another question with a rule action script that I can not figure out how to get to run. In this instance I want the script to sort messages from various members of a group into their respective mailboxes. The mail rule selects the group and sends it to the following Script.
    using terms from application "Mail"
    on perform mail action with messages theMessages for rule theRule
    tell application "Mail"
    repeat with eachMessage in theMessages
    set theSender to sender of eachMessage
    if theSender contains "+the full address of the sender+" then
    set mailbox of eachMessage to mailbox "+the desired mailbox+ "
    end if
    end repeat
    end tell
    end perform mail action with messages
    end using terms from
    What am I missing this time? This is the most recent version of several attempts.I may as well add, when I expand this to include the numerous members of the group, do I end each of the "if" statements with a "end if" or will the script evaluate several "if" statements in one toss. tT

    The most likely place it could fail is in the comparision:
    if theSender contains "the full address of the sender" then
    You should add some debugging to see whether this evaluates to true or false. If it's true and the message doesn't move that's a whole different problem from it evaluating false.
    As for the 'if' question, you can do it either way. Depending on the situation, one path may be more or less efficient than the other, so it may take some experimentation:
    In general, I try to group the statements into the action, not the clause - for example, if there are three clauses that cause a specific action then I'd have one if statement with three clauses rather than three separate if statements that all lead to the same task.

  • Sample Rule Action Script.scpt crashes mail app sometimes

    Hi, I know next to nothing about applescript, but today came across a post which seemed like it could be solved with a little rule triggered AppleScript action. So I ...
    1. dug up the 'Sample Rule Action Script.scpt', and copied it into ~/Library/Scripts/Applications/Mail/
    2. created a rule which applied to all email messages and triggered the script
    3. selected a message, and hit cmd option L to apply rules to the selection
    and up popped an alert panel. (expected behavior) But only the first time and only on one of my two machines. On the other Mail.app crashed. (unexpected behavior)
    But then I found I couldn't reliably run it repeatedly on the first machine after all. So I repaired permissions. Now I get the crashing behavior reliably.
    Any ideas what I'm doing wrong? The script is the one everyone should have under:
    /Library/Scripts/Mail Scripts/Rule Actions/Sample Rule Action Script.scpt

    hello Camelot. I hope this is not too far afield in this thread but its as close I can find in the current discussion topics. I've been attempting to write a script to filter flagged messages from the old messages (> 6 days old) I want to delete. I use the rule to send it to my script as you discuss. My script doesn't function but when I replace it with the Sample Rule Script, things run like a charm. (Although the text that Craig sites doesn't run.) My question is what's wrong with my script that it is not triggered. It is as follows, it is compiled, and I added a sound command to try and debug it. It didn't work.
    using terms from application "Mail"
    on perform mail action with messages theMessages
    tell application "Mail"
    play sound ..........+These 2 lines added in an attempt to ascertain if the messages where even passing+
    "Basso" ..................+through the script. No sound resulted; syntax?+
    set theflaggedstatus to flagged status of eachMessage
    if flagged status is false then
    delete message
    end if
    end tell
    end perform mail action with messages
    end using terms from
    The result is no result, nothing, nada. The old messages stay in the mailbox whether they are flagged or not. I inserted a standard change color of message rule above and below the "run Applescript" rule command and the messages are colored as they should be but the Applescript is not functioning. My script, at this point, seems overly complex for what it is, but it is the result of numerous attempts to get it working. I have a number of similar scripts written with basically the same consequence.
    If this post is outside the thread here, my apologies, if it is maybe you can redirect my inquiries. thanks tT

  • Unable to find Transfer Rules and Data Source for 0PERSON Info Source

    Hi,
    I'am working on SALES ANALYSIS Configuration with the help of SAP Best Practices.
    I'am trying to load Master Data Attributes/Texts/Hierarchies.
    I'am able to load for allmost all the InfoPackages which i created for particular DataSource.
    Now i need to load master data for 0PERSON InfoObject under that Person (Attributes) and Person (texts) are there,for this 2 Transfer Rules and the DataSource has to be defined by default as it is defined for other Attributes/Texts/Hierarchies.But i'am unable to find a DataSource and Transfer Rules to create a infopackage for PERSON Attributes and Texts.
    Please gudie me with a solution in order to get these Transfer Rules and DataSource for this Attributes and Texts.
    With regards,
    Pradeep.B

    Hi,
    Install the corresponding master data objects from Business content. Go to data source find out the needed datasource, replicate it. If you want you can migrate it also.
    If still you are not getting 0person masterdata object datasource & transformation structure, then you have to create the transformation, Infopackage.
    Hope if you will install the business content again, it will solve your problem.

  • Set up rule and lost mail!

    I thought I was doing a 'good' thing when I set up a rule in Mail that said if the email address does not contain my exact email address, please move it to the junk folder. I set it up for both my cable company's email address and for my Mac address. Went back into Mail- all messages gone from both accounts!! Wiped out. So I went back into Rules and removed both rules. The Mac mail reappeared but my cable company emails did NOT reappear. Now I can probably recover them cuz I back up every morning but since the backup this morning, of course I have gotten some emails which did not get backed up. What happened?! Where did they go? Can I get them back? Ugh! Judy

    I tried rebuilding the mailbox and that didn't help. Judy

  • How to set up the interaction between InDesign CS6 8.0 and Photoshop CS 6 - if Photoshop is installed and the 64 and 32-bit?? default InDesign refers to the 64-bit version of Photoshop and scripts do not work.

    how to set up the interaction between InDesign CS6 8.0 and Photoshop CS 6 - if Photoshop is installed and the 64 and 32-bit?? default InDesign refers to the 64-bit version of Photoshop and scripts do not work.

    Nice of you to point it out here as I at least don’t follow Mr.Nash’s blog regularly.

  • Business Rules and BPM

    Anybody here knows the difference between Business Rules and BPM..
    We can do pretty much everything with a Business Rules Engine as we would do with BPM , then in which scenario should we use BPM and in which scenario should we use Business Rules Engine?
    Ofcourse Business Rules Engine has more complex set of rules than any BPM product in the market for .eg. ILOG Business Rules...

    BPM and a rules engine are different. Both are important, but they have different uses.
    Oracle BPM Studio is used by Business Analysts and Developers to model processes, integrate underlying components (including business rules) and develop user interfaces.
    There's an Engine that executes the processes that have been modeled. It sends the work item instances to the right person or persons with the right data when the work item reaches an interactive activity in the process. Similarly the Engine has invokes the underlying components specified in the process when the work item instance reaches an automatic activity.
    There's an out of the box Workspace runtime that lets end users manage and run their work item instances as they flow throughout the processes.
    We can business rules inside the processes, but one does not replace the other.
    Dan

  • Problem with balance carry forward business rule and automatic adjustments

    Hi All,
    I faced with issue when run BCF business rule and consolidation process. According sap courses BPC440 members with A(automatic adjustments) type should carry forward automatically, and I(imputable), M (adjustments) members should carry forwarded by bcf business rule.
    When I set up my BCF business rule I use property "Category_for_ope" in Category dimension. But this rule not work properly, then I use notes:
    1784365 - Category_for_ope property should not effect Consolidation.
    1902677 - The property category_for_ope shall work for consolidation
    After applying those notes, system work as I aspect. After i run consolidation first time system carry forward my automatic adjustment from Category "Expected" to "PLAN_Y0" and this is correct!!!. But when i run consolidation process second and third time system duplicated automatic adjustments in Category "PLAN_Y0".
    Someone can help me with this Issue?
    And sorry for my english

    Hi,
    Can you try as follows :
    *RUN_PROGRAM COPYOPENING
    CATEGORY = %C_CATEGORY_SET%
    CURRENCY = %RPTCURRENCY_SET%
    TID_RA = %TIME_SET%
    *ENDRUN_PROGRAM
    hope it helps...
    regards,
    Raju

Maybe you are looking for

  • Error message "com.sap.aii.af.ra.ms.api.DeliveryException: "

    Hi Team, Created a simple file2file scenarion successfully. Unable to pick the file from Sender directory to Receiver Directory. Checked from monitoring the Communication Channel. Error message shown for sender communication channel as below:   Commu

  • Time Capsule won't recognize External Hard Drive?

    Ok so I have a 1 TB Time Capsule that I previously had a 1 TB G-Drive attached to store excess data, movies, ect. I needed more space so I purchesed a 6TB G-Drive, connected it to my Mac Book Pro and coppied all the information to it from my other tw

  • Firefox can't play Boost Mobile ringtones without a supposed "ActiveX" script, what kind of script do I need?

    When I go to the Boost Mobile website and try to listen to ringtones there it directs me to a website to download a type of ActiveX script/plugin for Firefox. Well, the latest version is for Firefox 1.5, which is long gone. I'm not sure what kind of

  • I can't download Premiere ProCC

    i'm trying to download Premiere ProCC from the website but insted it's downloading the Creative Cloud. ok, i installed it but i can't find the Premiere Pro in there.

  • Distorted pictures in webpages

    This problem has been plaguing me for some time now. Running the latest version of Firefox and plug-ins. This is what I see on websites. http://img62.imageshack.us/img62/9679/wtfsd.jpg Not all pictures look that way, it's hit and miss. After doing a