12,297
edits
mNo edit summary |
mNo edit summary |
||
Line 36: | Line 36: | ||
set theNumber to value of e | set theNumber to value of e | ||
set amtsholung to true | set amtsholung to true | ||
set theNumber to theNumber | -- to get rid of (0) | ||
set the theNumber to removeChars(theNumber, "(0)") | |||
set the theNumber to removeChars(theNumber, " ") | |||
set lengthOfNumber to length of theNumber | set lengthOfNumber to length of theNumber | ||
-- the following lines replace the international prefix for germany (+49, or 0049) with 0 | -- the following lines replace the international prefix for germany (+49, or 0049) with 0 | ||
if theNumber begins with "+49" then | if theNumber begins with "+49" then | ||
Line 55: | Line 57: | ||
if theNumber begins with "03643" then | if theNumber begins with "03643" then | ||
set theNumber to characters -1 thru -(lengthOfNumber - 5) of theNumber as text | set theNumber to characters -1 thru -(lengthOfNumber - 5) of theNumber as text | ||
end if | |||
--in case it's an internal number ommit the prefix | |||
if theNumber begins with "58" then | |||
set theNumber to characters 3 thru 6 of theNumber as text | |||
set amtsholung to false | |||
end if | end if | ||
end ignoring | end ignoring | ||
Line 107: | Line 109: | ||
tell application "System Events" to (name of processes) contains appName | tell application "System Events" to (name of processes) contains appName | ||
end appIsRunning | end appIsRunning | ||
--variation from http://www.macosxautomation.com/applescript/sbrt/sbrt-06.html | |||
on removeChars(theChars, searchString) | |||
set AppleScript's text item delimiters to the searchString | |||
set the itemList to every text item of theChars | |||
set AppleScript's text item delimiters to "" | |||
set theChars to the itemList as string | |||
set AppleScript's text item delimiters to "" | |||
return theChars | |||
end removeChars | |||
</syntaxhighlight> | </syntaxhighlight> | ||
===Known Bugs=== | ===Known Bugs=== | ||
# browser window opens and resizes | # browser window opens and resizes | ||
# doesn't work with ugly number formats like +49 (0)170 123456789 | # <s>doesn't work with ugly number formats like +49 (0)170 123456789</s> | ||
# <s>since recently the webdialer stopped working (for me?) hence the whole script has become useless. investigating the issue.</s> that turned out to be a hardware issue of the phone. replaced phone and it works again. | # <s>since recently the webdialer stopped working (for me?) hence the whole script has become useless. investigating the issue.</s> that turned out to be a hardware issue of the phone. replaced phone and it works again. | ||
# <s>stopped working after internal call fix</s> fixed, works again | # <s>stopped working after internal call fix</s> fixed, works again |