Phone number to script as a default action

Sharing and discussing custom actions for LaunchBar
bernd
Rank 1
Rank 1
Posts: 34
Joined: Tue Jul 24, 2012 10:50 pm

Phone number to script as a default action

Postby bernd » Tue Jul 24, 2012 11:27 pm

Hi,

from Gigaset I have this script as an example:

Code: Select all

tell application "QuickSyncServices.service"
   dial "089 12345" with phone "SL78H"
end tell

When I run this script from the AppleScript Editor this works fine.

Now I want to open (not send) phone numbers via LaunchBar with this script (Preferences > Actions > Default actions > Phone numbers: open script). But of course this script needs a modification, which puts the choosen phone number between the quotation marks that in this example hold the <<089 12345>>.
But sorry, I don't know how to do it. Maybe I am the worlds biggest AppleScript dummie, however, I hope that someone very kind helps me with the modification.

Kind regards,
Bernd

bernd
Rank 1
Rank 1
Posts: 34
Joined: Tue Jul 24, 2012 10:50 pm

Re: Phone number to script as a default action

Postby bernd » Tue Jul 31, 2012 3:08 pm

You're welcome! If you know how to make use of this with LaunchBar, please let me know.

ptujec
Wizard
Wizard
Posts: 321
Joined: Fri Dec 19, 2008 11:36 am
Contact:

Re: Phone number to script as a default action

Postby ptujec » Thu Aug 02, 2012 5:32 pm

You can try this:

Code: Select all

on handle_string(s)
    if s starts with "tel:" then
        set s to text 5 thru -1 of s
        -- trims the URL's "tel:" scheme prefix
    end if
    tell application "QuickSyncServices.service" to dial s with phone "SL78H"
end handle_string


Also see: http://www.obdev.at/resources/launchbar ... oneNumbers

bernd
Rank 1
Rank 1
Posts: 34
Joined: Tue Jul 24, 2012 10:50 pm

Re: Phone number to script as a default action

Postby bernd » Thu Aug 02, 2012 7:18 pm

ptujec wrote:You can try this:
...


It works! Thank you so much, Sir!

This is so great - I'm so much faster with LaunchBar than with fiddling with the address books of my phones, that I always let LaunchBar display the number and dial manually. Until today. :D This means a great time saver and huge comfort to me, you really make me happy.

I also tried some code similar to the code in the LaunchBar's help section you pointed me too, but I always assumed, the number had to be within the brackets as shown in the original. So I didn't try the most obvious.

Thanks again!
Bernd

Hendrik
Posts: 2
Joined: Sun Sep 02, 2012 8:59 pm

Re: Phone number to script as a default action

Postby Hendrik » Sun Sep 02, 2012 9:02 pm

Thank you, you've helped me also out!

I'am new to this program, and is is possible with a command or something to type in the phonenumber after Control + Space without have the phone number in the addressbook?
When I try it, it searching in files and internet history. With PHN the number must exists in the addressbook.

ptujec
Wizard
Wizard
Posts: 321
Joined: Fri Dec 19, 2008 11:36 am
Contact:

Re: Phone number to script as a default action

Postby ptujec » Sun Sep 02, 2012 10:42 pm

Sure.
In this case you bring up the script (cmd-space and then start typing the name of the script) in LaunchBar and hit space. Now you can enter the phone number.

Hendrik
Posts: 2
Joined: Sun Sep 02, 2012 8:59 pm

Re: Phone number to script as a default action

Postby Hendrik » Mon Sep 03, 2012 2:28 pm

you're a hero!

I've create a script and named it: bel.applescript
Via index -> show index -> New -> Custom Lists -> Unix Executables and then selected my script and give it name bel.

Now, when i typ bel I got first a result from the browser and when i click to bel with the applescirpt icon, then space, the number and enter, it works!

Is it posible to set command "bel" to the applescript as default action?

ptujec
Wizard
Wizard
Posts: 321
Joined: Fri Dec 19, 2008 11:36 am
Contact:

Re: Phone number to script as a default action

Postby ptujec » Mon Sep 03, 2012 2:34 pm

Yes, you can assign abbreviations manually. I usually use cmd-option-a to do that.


Return to “LaunchBar Actions”

Who is online

Users browsing this forum: Google Feedfetcher and 2 guests