Applescripting

Applescript

Like many of From Concentrate Software’s applications, SiteTagger is applescriptable. This page describes some of the classes, attributes, and commands that SiteTagger makes available to scripters.

Commands

add new bookmark
You can add new bookmarks to SiteTagger by using this command. It takes four arguments, two are optional, two are required.

sync with browsers
SiteTagger can synchronize it bookmarks with several major Mac OS X web browsers. You can schedule regular backups using applescript. Simply use sync with browsers and SiteTagger will show the sync window and start the process.

sync with services
Like sync with browsers, SiteTagger can synchronize its bookmarks with del.icio.us, Furl, and ma.gnolia. Invoking this command will show the sync window and start synchronizing SiteTagger with all available accounts.

associate
Bookmarks must be associated with services in order to be synchronized with them. The associate command provides a mechanism for relating bookmarks and services. After being associated, bookmarks will be considered whenever syncing with a service happens.

    tell application "SiteTagger"
        set l to online services
        set os to last item of l
        set b to first bookmark
        associate bookmark b with online service os
    end

disassociate
Just as bookmarks can be associated with certain services, they can also be disassociated from them. Bookmarks will not be removed from the online service but they will cease to be considered during synchronizations.

tell application "SiteTagger"
    set l to online services
    set os to last item of l
    set b to first bookmark
    disassociate bookmark b from online service os
end

bookmarks sorted
SiteTagger can arrange and return bookmarks sort date or name, ascending or descending. You can also limit the number returned.

tell application "SiteTagger"
    set x to bookmarks sorted by date count 10
end

run script
Support for applescript is built into SiteTagger but extra scripting language components can be located on SiteTagger’s extras page. You can then integrate these scripts with applescript by utilizing the run script command. Here’s a simple example using the Python scripting plugin:

#!/usr/bin/env python
# Saved to ~/Desktop/reverse.py
selectedBookmark.setTitle_(selectedBookmark.title().reverse())


-- Applescript
run script at path "~/Desktop/reverse.py"

Classes

Application
You can access the bookmarks directly from SiteTagger. If you wanted every bookmark, you could use set every_bookmark to every bookmark, but that isn’t recommended. If you wanted to access a certain bookmark, you can use set bk to bookmark 1. You can also use the command get selected bookmark to access the bookmark that is currently selected in SiteTagger.

bookmark
The bookmark class is the basic object that you’ll be using when scripting SiteTagger. It has 9 attributes. All of the attributes can be gotten and set by referencing them normally (set n to name of bookmark bk; set name of bookmark bk to n).