Page 1 of 1

Adium Applescript development - newb help

Posted: Sat Oct 22, 2005 6:32 pm
by quis
Hey, I've been trying to make an applescript that will open the msn member profile of your current contact when you type /mem. Currently it works when running the script in applescript editor but nothing happens when I type /mem in Adium. I copied a working package so it looks like this:

Code: Select all

MSNProfile.Adiumscripts
|__Contents
   |__Info.plist
   |__Resources
      |__mem.scpt
Info.plist looks like this:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>CFBundleDevelopmentRegion</key>
	<string>English</string>
	<key>CFBundleGetInfoString</key>
	<string>MSN Profile</string>
	<key>CFBundleIdentifier</key>
	<string>com.adiumx.msnprofile.scripts</string>
	<key>CFBundleInfoDictionaryVersion</key>
	<string>1.0</string>
	<key>CFBundleName</key>
	<string>MSN Profile</string>
	<key>CFBundlePackageType</key>
	<string>AdIM</string>
	<key>Scripts</key>
	<array>
		<dict>
			<key>File</key>
			<string>mem</string>
			<key>Keyword</key>
			<string>/mem</string>
			<key>Title</key>
			<string>MSN Profile</string>
		</dict>
	</array>
	<key>Set</key>
	<string>MSN Profile</string>
</dict>
</plist>
And the important part of the script looks like this:

Code: Select all

on substitute()
	tell application "Adium"
		activate
		tell the active chat of the first interface controller
			set member to ID
		end tell
	end tell
	set member to make_formatted(member, "MSN.", "")
	tell me to do shell script "open http://members.msn.com/" & member
end substitute
Anyone have any ideas on how to make this work? Thanks in advance...

Posted: Sat Oct 22, 2005 6:45 pm
by snarfer
If you're using the latest beta, /script won't work. You should change it to %_script for users of the beta.

Posted: Sat Oct 22, 2005 6:49 pm
by quis
I'm using Adium 0.85, 2nd October. I've changed the /mem part in Info.plist to %_mem but it doesn't seem to make any difference. It would be really handy if there was a page that covered basics like these...

Posted: Sat Oct 22, 2005 7:04 pm
by snarfer
You can access Adium's scripting abilities through Script Editor.app, look in the file menu for "Open Dictionary...".

Posted: Sat Oct 22, 2005 7:30 pm
by quis
Like I said, the script works, I just can't call it from Adium. I suspect that this is something to do with the plist file, so are there any changes I need to make there?

Posted: Sat Oct 22, 2005 7:33 pm
by snarfer
Seems fine to me...

Posted: Sat Oct 22, 2005 7:45 pm
by quis
Mysteriously seems to be working now - my bad. I'll post here when it's accepted onto the xtras site, thanks a lot for your help dude.

Posted: Sat Oct 22, 2005 8:17 pm
by snarfer
quis wrote:Mysteriously seems to be working now - my bad. I'll post here when it's accepted onto the xtras site, thanks a lot for your help dude.
Glad I could help.

Posted: Sun Oct 23, 2005 10:51 pm
by quis
Here it is on the Adiumxtras site. I hope people find this useful, and thanks again.

Posted: Wed Oct 26, 2005 3:01 am
by zaudragon
You could’ve just not used Contents or Resources at all:

Code: Select all

MSNProfile.Adiumscripts 
|__Info.plist 
|__mem.scpt