o . Q
_—__ "You live and you learn; or you don't live long." - Lazarus Long
you can launch desktop apps from the browser by associating a particular mime type with the application.
as a bonus, most browsers allow you to remember these associations, so autonomous interaction is possible after the initial choice is made.
Last edited by MartinLiss; 03-21-2011 at 04:29 PM.
use the syntax i posted: your code has a 0byte body, which is probably forcing the whole thing to be ignored.
it should ask you "open or save" when the code runs.
review dataURI syntax for clarification
I did the following and no errors but again nothing happens
As an experiment I also found and tried this but no window showed up.
myWindow.document.write("<p>This is 'myWindow'</p>");
does the code i posted do anything?
if it opens a save/run dialog, then choose to open it with CP, and check the option to remember the choice.
for this situation, it's easier to make up a new and unique mime for your app than wrestle default handling with browsers and OSs.
if you want to actually open the file, it should not be fake, but you can at least trigger (and re-trigger executable) using my simple method.
perhaps opening the app by passing an invalid file terminates the app.
if that's the case, create a wrapper executable that ignores the file passed, but executes the actual app you need.
usually, you can browse for executable files to handle unknown mimes, so just browse to your wrapper in the open/save dialog...
Last edited by rnd me; 03-21-2011 at 11:29 PM.
"does the code i posted do anything?" ==> No
"if it opens a save/run dialog, then choose to open it with CP, and check the option to remember the choice." ==> It doesn't open any dialog at present. When you mention CP are you talking about my CP? Because my CP is just an AppleScript Color Picker made into an app. I don't understand the reference to checking and choices.
"for this situation, it's easier to make up a new and unique mime for your app than wrestle default handling with browsers and OSs." ==> You completely lost me here.
"if you want to actually open the file, it should not be fake, but you can at least trigger (and re-trigger executable) using my simple method." ==> It's not a (data) file, it's an app.
"if that's the case, create a wrapper executable that ignores the file passed, but executes the actual app you need.
usually, you can browse for executable files to handle unknown mimes, so just browse to your wrapper in the open/save dialog…" ==>???
Let me give a full explanation of what I'm trying to do. I'm an Administrator at VBForums (another Internet.com forum which is also vBulletin-based) and I've recently switched from a PC and IE to an iMAC and Safari. On IE I had a whole set of customized context menu items that made my life easier when dealing with posts in our forums. Some allowed me to enter boilerplate text in posts, some duplicated the Bold, Italic, etc buttons above, and some did other things. To duplicate those things for Safari I've been writing several (actually over a dozen) context menu extensions. Most of them already work but I've been having trouble with one that would allow me to highlight some text, choose the 'Color' context menu item and have it bracket the text with tags that would produce for example this (The tags look like [color="#00FF40"]this[/color])
The IE 'Color' context menu item that I'm trying to replace is based on the MicroSoft Common Dialog control and I'm trying to base one off of OS x's Color app. My CP AppleScript calls the Color app and generates the hex value.
In case you aren't aware the context menu items are based on basically two files, a global html file and a JS file. The html file tells the JS file what context menu item has been selected and the JS file acts on it.
I've attached the CP Applescript which you can look at if you like and/or open the OS X AppleScript Editor and use it to save my script as an app and then run it.
Thanks for your help so far.
The problem might be that both are client-side languages. And they are developed by different companies.
Originally Posted by MartinLiss
For instance, take the server side: I don't think there is way to call a PHP function using ASP. Or to save a CorelDraw working sheet in Adobe Illustrator format. Usually all you can do across different things is to translate (and not always is possible) the final data (but not the inner functionality of a program/tool or another) using a common understandable format. XML or JSON, in case of data. EPS in case of images... and so on
i would use a dhtml color picker if that's all you need. there are several xbrowser packages floating around...
the code i posted trigger the handler box in firefox on windows.
Can you get it to work with Safari?
Originally Posted by rnd me
Originally Posted by Kor
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)