<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; ">Does anyone have experience creating a pure python app (no Cocoa integration) which is associated with a document extension?<DIV><BR class="khtml-block-placeholder"></DIV><DIV>We would like to be able to launch our application by double-clicking an associated document (associated using CFBundleDocumentTypes in the info.plist) and having the data in the document loaded into the python app. I have added the following code to our setup.py file:</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco"><BR class="khtml-block-placeholder"></FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco">plist = dict(</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco"> </FONT><FONT class="Apple-style-span" face="Monaco">CFBundleDocumentTypes = [</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco"> </FONT><FONT class="Apple-style-span" face="Monaco">dict(</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco"> </FONT><FONT class="Apple-style-span" face="Monaco">CFBundleTypeExtensions=[</FONT><FONT class="Apple-style-span" color="#891315" face="Monaco">"madf"</FONT><FONT class="Apple-style-span" face="Monaco">,],</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco"> </FONT><FONT class="Apple-style-span" face="Monaco">CFBundleTypeName=</FONT><FONT class="Apple-style-span" color="#891315" face="Monaco">"myApp Data File"</FONT><FONT class="Apple-style-span" face="Monaco">,</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco"> </FONT><FONT class="Apple-style-span" face="Monaco">CFBundleTypeRole=</FONT><FONT class="Apple-style-span" color="#891315" face="Monaco">"Editor"</FONT><FONT class="Apple-style-span" face="Monaco">,</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco"> </FONT><FONT class="Apple-style-span" face="Monaco">CFBundleTypeIconFile=</FONT><FONT class="Apple-style-span" color="#891315" face="Monaco">'myAppDocument.icns'</FONT><FONT class="Apple-style-span" face="Monaco">,</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco"> </FONT><FONT class="Apple-style-span" face="Monaco">),</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco"> </FONT><FONT class="Apple-style-span" face="Monaco">]</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco">)</FONT></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco">py2app_options = dict(...,</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco"> </FONT><FONT class="Apple-style-span" face="Monaco">plist=plist,</FONT></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Monaco"> </FONT><FONT class="Apple-style-span" face="Monaco">)</FONT></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>the application now launches when we double-click on the document, but I have yet to find how we might feed the contents of the document to an appropriate reader function inside our app. We had a look at the sys.argv list passed in to main.py thinking the name of the document might be in there but this doesn't seem to be the case. We also checked os.environ.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><DIV>Thanks for any help or pointers to relevant info,</DIV><DIV>Mike</DIV><DIV><BR class="khtml-block-placeholder"></DIV></DIV></BODY></HTML>