TextExpander 3.3.4 and Japanese, Chinese, etc. Input Methods

Philip Blog, News

support@smilesoftware.com. TextExpander v. 3.3.4 and above has a setting which can restore expansion and capitalization correction for any language where it is currently disabled. TEIMPrefSetter can be used to change that setting: Download TEIMPrefsetter Here is how to use TEIMPrefSetter:

  1. Quit TextExpander
  2. Launch TEIMPrefSetter
  3. The list contains languages where TextExpander will _not_ expand. Select the language(s) that you want to expand in.
  4. Click the ‘-‘ button to remove that language(s) from the list
  5. Click the “Save” button to save your changes
  6. Quit TEIMPrefSetter
  7. Launch TextExpander
Again, if you have comments or feedback, please let us know.

Fix Dock Hiding for TextExpander 3.3 on the Mac App Store

Philip Blog, News

  • Quit TextExpander if it is running.
  • Download the “Fix TextExpander 3.3.zip” file.
  • Double-click to expand the file to “Fix TextExpander 3.3.scpt”
  • Double-click “Fix TextExpander 3.3.scpt” to load it into AppleScript Editor
  • Press Run
  • After the script completes, launch TextExpander (and quit AppleScript Editor)
  • Our apologies for the inconvenience. This will be fixed in our next update. Note: After running this script, it may appear that TextExpander is not installed in the Purchased section of the App Store application. If you Install at the next update, that will no longer be an issue. Update, 5/20/2011: An update with the fix is now available on the Mac App Store. Thanks for your patience.

    AppleScript and Shell Script Snippet Issues in TextExpander 3.3

    Philip Blog, TextExpander

    AppleScript Snippets If you create a new snippet and set it to AppleScript, TextExpander 3.3 still treats the new snippet as a text snippet. When you expand it, the result will be the content of the AppleScript, not the script results. Any AppleScript snippets you created in earlier versions are still treated as AppleScript snippets. As a workaround, you can duplicate an existing AppleScript snippet and then edit its contents. Apple Script and Shell Script Snippets and “%” This issue with shell script and AppleScript snippets involves the % (percent) symbol. TextExpander has always used % to delimit macros. In a script snippet,  TextExpander 3.3 is treating the % as a macro delimiter, which allows you to embed snippets within script snippet source code, but this has the unfortunate side effect of misinterpreting occurrences of ‘%’ as a character. One workaround is to use 2 percentage signs (%%) to “escape” the % character (TextExpander power user @drdrang posted more about this on his blog), but this is inconvenient and does not work if the script snippet itself is embedded within another snippet. If you use script snippets a good deal, you may want to consider reverting back to TextExpander 3.2.4. We do apologize for the aggravation and we hope to release a fix shortly in TextExpander 3.3.1.


    AppleScripting TextExpander

    Philip Blog, TextExpander, TextExpander Tips

    TextExpander version 3.3 [download] introduces AppleScript support, primarily oriented toward automating snippet and group management. TextExpander includes AppleScript support for:

    • creating and deleting groups
    • editing group properties
    • creating and deleting snippets
    • editing snippet properties
    • adding (importing) groups from files or from URLs
    • enabling/disabling expansion

    These capabilities should be broad enough to allow for some interesting scripts to be created. As you develop scripts, you may encounter some limitations. Your feedback will help determine future expansion of TextExpander's AppleScript vocabulary. Here are a couple of sample scripts to get you started. The first one creates a new group and then creates two snippets within it:

    tell application “TextExpander”

    –– create a new group

    make new group with properties {name:”My New Script Group”}

    set newGroup to the result

    tell newGroup

    –– create a snippet, then set the major properties one by one

    make new snippet

    set newSnippet to the result

    set the abbreviation of newSnippet to “tastytreat”

    set the plain text expansion of newSnippet to “Toasted marshmallows are a tasty treat”

    set the label of newSnippet to “Snippet from AppleScript”

    –– create a snippet, setting properties immediately

    make new snippet with properties {label:”Second Scripted Snippet”, abbreviation:”scrptwo”, plain text expansion:”Eat Two Marshmallows”}

    set secondSnippet to the result

    end tell

    end tell

     

    The second script checks for the existence of a URL-based group. If no such group is found, that URL is imported:

     

    –– This script checks to make sure that a group based on a particular URL is present.

    –– If not, it imports that group

    set success to false

    set groupURL to (“http://www.smilesoftware.com/te/example.textexpander” as text)

    –– note coercion above: TE group source is type text, not URL

    tell application “TextExpander”

    set sourceList to the source of every group

    if sourceList contains groupURL then

    –– the desired group is already present

    set success to true

    else

    set newGroup to import URL group using URL groupURL

    –– the returned group is a placeholder for URL contents, which are downloaded asynchronously

    repeat with i from 1 to 10

    delay 1 –– allow some time for download, then poll the group placeholder

    tell newGroup

    –– find the number of snippets in the group

    –– unless the group is supposed to be empty, zero snippets indicates download failure

    count snippets

    set snipCount to the result

    if snipCount is not equal to 0 then

    set success to true

    exit repeat

    end if

    end tell

    end repeat

    end if

    end tell

    if not success then

    beep –– real error handling goes here

    end if

     

    Again, we welcome your feedback on TextExpander's new AppleScript capabilities.


    Automate HTML to PDF with PDFpenPro 5.2.3

    Philip Blog, PDFpen, PDFpen Tips

    PDFpenPro 5.2.3 can now automate the creation of PDFs from web pages via AppleScript. Here’s an example:

    tell application “PDFpenPro”

    activate

    set theDoc to make new document with data “http://smilesoftware.com” with properties {levels:2, top margin:36, bottom margin:36, right margin:36, left margin:36, follow:server, maximum pages:100}

    end tell

    The return value is the created document. You’ll find additional information on converting HTML to PDF with PDFpenPro in the PDFpenPro help. You can upgrade from PDFpen to PDFpenPro for US $40. In addition to being able to convert websites to multi-page PDFs, you’ll also be able to create cross-platform fillable forms and to construct document table of contents with PDFpenPro.