We are updating our email signatures in the company I work for and since the last update a lot of our employees have swithes to Mac. Allthough they have switched, few are techincal experts.
Many of our users use the Mail app in OSX. To install a HTML signature in the Mail app it quite an hassle which I would like to improve for these users.
What I want to do is to create an OSX app that uses an build in template and filles that template with the users name, job title, phone number ect.
BUT, now the "hard" part comes... how can I make a webarchive from the HTML page that is the result of the template?
And also, can I programaticly add this to Mail?
Best regards,
Paul Peelen
Creating .webarchive is easy. Use the command line tool textutil, or use WebView's method [[[webView mainFrame] dataSource] webArchive] to get it.
You can change the signatures stored in Mail.app via Applescript. See its dictionary using AppleScript Editor.app. It accepts a rich text as an argument, so you might want not the webarchive but a rich text.
You can also look at my Applescripts on Mail signatures - hints.macworld.com that a wrote a while ago.
Which may be of some help. They use Textutil to import and export Mail signatures.
Also have a look at Preferences Utilities Reference which may help you to update the SignaturesByAccount.plist in Objective C.
And the value Types section of Accessibility Roles and Attributes Reference to get an idea of the the abstract value types, and their specific C and Objective-C types. I.e NSArray = CFArrayRef. You will need those for the plist.
Related
This is my first time using Ektron and i'm trying to implement Json-LD schema scripts for each page. I have 68 scripts that I need to implement that are unique for each page.
I thought I would be able to implement these scripts through meta data, but now i'm unsure. Each script is over 1000 characters, the html and meta tag types only allow 500 characters, so i'm assuming i'm in the wrong place. If anyone could shed some light it would be much appreciated.
Ektron's metadata isn't intended for large chunks of data / content. So, yes, you will find limits there.
Here are two things you might try as workarounds.
Most direct:
Use the Ektron Library. Go to the Library tab and click on the Root node and view Properties. Add an extension to allow you to upload your JSON-LD as a file. Use metadata on the content item to reference the uploaded file. Combine the two upon output.
If you want the JSON-LD to be editable within the CMS...
Gaming the platform a bit
Create a new SmartForm definition and include in it a single plain-text, multi-line field (not Rich text). This should hold your JSON-LD. Set up a folder and, if your version supports it (you didn't specify CMS version, so I will assume relatively recent), set the folder to be non-searchable so these things don't come up in site search results. Add a restriction to the folder to only allow the Smart Form definition you just created. Create your JSON-LD there using the plain-text field. You should be able to store up to 1MB.
Same as above, add your JSON-LD as text then use a reference to this item from the content you want to use it.
The metadata in this case (and possibly the library one, though I'd have to test and I don't have an Ektron environment for development anymore) will give you the Content ID for the object holding your JSON-LD. You'll have to make another API call but will give you the solution you appear to want from above.
I'm using Objective-C. I wonder is there any plug-ins or libraries that can allow me to modify the default receiver list in system Mail app?
For example, I have made an app which can scan a card and fetch the E-mail information on it.
Now, I'd like to put the E-mail data I've fetched into system Mail app's receiver list. That is, when I use the system Mail app and write a new mail, I can see the E-mail address I fetched when I type some letters in the receiver column.
Is that possible to achieve?
This list is stored as a Sqlite database and it should be possible to append to it from another process, even while Mail.app is running. I haven't tested it, though.
The following article should help. It describes how to delete entries but adding new ones would work in pretty much the same way: http://hints.macworld.com/article.php?story=20110516152604993
I'm about to create an application that uses JSON to update its content.
This is how I planned it to work:
When application starts, it checks (with internet connection is available) if the JSON file set on remote server is newer than the one stored localy - if it is then it's downloaded.
Then, the application applies data from that JSON to the content. For example, to the "Contact" information - it applies data like phone numbers etc.
My question is, is it in your opinion, a good technique to update appliactions content?
Does anynone had an experience with building app with this kind of idea?
Best regards,
Zin
Of course you can do this. One thing that may lead to a better user experience would be to ask the user for his permission to download new content (if there is something new).
This is a normal thing to do. I have a phonebook app that does exactly this. On a side note, if you need a network class to handle the web-service interaction, see this SO post. I wrote a custom network class that works with AFNetworking.
When a document is opened in an application from another app, the file name passed into application:openURL:sourceApplication:annotation: is pretty nonsensical for display purposes. The annotation portion of this message should contain an NSDictionary containing user information, like a friendly file name. Since the structure of this field is pretty loose, is there any site that has attempted to aggregate what different apps use when passing that meta-data to other applications?
I realize that trying to account for all apps would likely be an exercise in futility, but being able to handle a few popular applications would be useful to try and accommodate.
http://handleopenurl.com/scheme, and a few more at http://wiki.akosma.com/IPhone_URL_Schemes.
Foreword: I want to allow users to define high quality document templates and then inject there data from our information system and print the result. I think MS Word is a great starting point, because this work is aimed to business letters etc., not data reports.
Question: Is it possible to add a custom field provider to MS Word?
I don't have English MS Word, so I must try to describe what I mean in a few sentences. Normally we can insert "fields" like author name, current date etc. These fields work seamlessly. We can switch view of fileds between data and definition. Definion of author field looks like this: { AUTHOR \\* MERGEFORMAT }.
Now I want to inject external data into documents and let user specify where to put them. A user should define a document template and mark spots where external data should be injected. Since Word users generally aren't IT experts, the easiest way for them is to use some macros or "insert field" option to do it. So I want to define my own set of fields and connect Word to my custom field and data provider. How to do it? I am unable to find any documentation on this.
I think this approach is better than using sql database connection or something like that, because I want to let the external source define list of known fields and their values, not the docx document itself. Also, data source won't actually be an sql database.
Yes you can do this by using Custom Document Properties as placeholders and then use some VBA code to set those properties to whatever you want. You can get the data via ODBC or from an Excel spreadsheet or from a text file.
First of all, experiment manually by going into File, Properties and creating some custom properties. Give them a value and then, in the document, insert some DocProperty fields. If you can't find DocProperty in your language version of Word then look through a list of the fields like Author etc. Since field names are visible to end users they might have been translated.
Then in order to complete your document template, create a VBA function that uses SetProperty. Read this article for more details. It is up to you whether the VBA is triggered by opening the file or whether you add a menu item to do that.
No need for special controls or any commercial add-ons. I'm going to add a VBA tag to your question since this is really a VBA programming question. In fact, this has been possible since Word for Windows 1.0.
Using SetProperty in VBA is a bit more complex now. I got the following snippet of code from this forum posting.
object docProps = wdDoc.CustomDocumentProperties;
Type docPropsType = docProps.GetType();
object Prop = docPropsType.InvokeMember("Item",
BindingFlags.Default |
BindingFlags.GetProperty,
null, docProps,
new object[] {propName} );
Type PropType = Prop.GetType();
PropType.InvokeMember("Item",
BindingFlags.Default |
BindingFlags.SetProperty,
null, docProps,
new object[] {propName,propValue} );
Absolutely, this is the exact kind of scenario that Content Controls and CustomXMLParts were built for (Word 2007/2010 only, not earlier .doc format).
Most of the Word Developer Center home page deals with these two: Content Controls and CustomXMLParts. If you go this route, you'll find the Word Content Control Toolkit an invaluable resource as well, especially when just starting out.
From an end-user perspective, it could be as simple as just creating buttons on the Ribbon for insertable Content Controls via a template or document add-in (VSTO or VBA).
If you want a fairly decent prebuilt solution, check out Windward reports.
Yeah, the name makes it sound like a reporting tool, but in reality, it's exactly what you're describing. They have a Word add in that allows users to easily mark up a word doc with fields to be inserted from your data source.
I built a very similar system for a law firm. Windward didn't do quite everything I needed it to do, but at the same time, it's pretty powerful.