Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

Double clicking created app file, opens in wrong program (Real Studio getting started Mailinglist archive)

Back to the thread list
Previous thread: listbox with variable heights
Next thread: opening two IDE windows


RB Database   -   tom.russell transport.alstom.com
  Double clicking created app file, opens in wrong program   -   Mark Cooke
   Re: Double clicking created app file, opens in wrong program   -   CV
   Re: Double clicking created app file, opens in wrong program   -   Mark Cooke
   Re: Double clicking created app file, opens in wrong program   -   Harrie Westphal
   Re: Double clicking created app file, opens in wrong program   -   CV
   Re: Double clicking created app file, opens in wrong program   -   Mark Cooke
   Re: Double clicking created app file, opens in wrong program   -   Sven E Olsson
   Re: Double clicking created app file, opens in wrong program   -   Sven E Olsson
   Re: Double clicking created app file, opens in wrong program   -   Mark Cooke
   Re: Double clicking created app file, opens in wrong program   -   Harrie Westphal
   Re: Double clicking created app file, opens in wrong program   -   Arnaud Nicolet

Double clicking created app file, opens in wrong program
Date: 11.02.06 00:15 (Fri, 10 Feb 2006 23:15:26 +0000)
From: Mark Cooke
Hi,

Using OSX (Tiger) I'm having major problems trying to get any files
created with my application to open up when I double click them.
The documents are in XML format, but they all end with a *.pmb
extension, which set this up in the filetypes (in RB).
according to the User Guide, I've given the application the unique 4
digit MacCreator code (checked with Apple first).

The application reads and writes files ok with using the menu or If
drop the created file on the application icon.
(and they also get their own unique icon), but double clicking the
files open up in TexEdit instead.

I know I could manually associate the file type with the application,
but is there a way to do this via REALbasic? as I thought that was
the idea of giving it the MacCreator code; so it
writes this to the file, so it knows what application to open with.

Thanks in advance.

Mark
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Double clicking created app file, opens in wrong program
Date: 11.02.06 01:08 (Fri, 10 Feb 2006 16:08:00 -0800)
From: CV

On Feb 10, 2006, at 3:15 PM, Mark Cooke wrote:

> Hi,
>
> Using OSX (Tiger) I'm having major problems trying to get any files
> created with my application to open up when I double click them.
> The documents are in XML format, but they all end with a *.pmb
> extension, which set this up in the filetypes (in RB).
> according to the User Guide, I've given the application the unique
> 4 digit MacCreator code (checked with Apple first).
>

You also have to put your file opening code in App_OpenDocument event.

Best,

Jack
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Double clicking created app file, opens in wrong program
Date: 11.02.06 08:54 (Sat, 11 Feb 2006 07:54:53 +0000)
From: Mark Cooke
As I said in the original posting this works, otherwise the
application would not open the files, when I drag them on top of the
app or icon.
It's only when I double click the created document, that it opens in
TextEdit, rather than my application.

On 11 Feb 2006, at 00:08, CV wrote:

>
> On Feb 10, 2006, at 3:15 PM, Mark Cooke wrote:
>
> You also have to put your file opening code in App_OpenDocument event.

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Double clicking created app file, opens in wrong program
Date: 11.02.06 16:24 (Sat, 11 Feb 2006 09:24:48 -0600)
From: Harrie Westphal

On Feb 11, 2006, at 1:54 AM, Mark Cooke wrote:

> It's only when I double click the created document, that it opens
> in TextEdit, rather than my application.

Is one of your RB programs creating this file? If so did you set the
MacCreator and MacType of the file when it was created. Something like:

f.MacCreator=kMacCreator
f.MacType=kMacType

Where constants, in this case, are being used to assign the proper
values to the two properties.

=kD A Mac addict in Tennessee =_
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Double clicking created app file, opens in wrong program
Date: 11.02.06 17:38 (Sat, 11 Feb 2006 08:38:10 -0800)
From: CV

On Feb 11, 2006, at 7:24 AM, Harrie Westphal wrote:

>
> On Feb 11, 2006, at 1:54 AM, Mark Cooke wrote:
>
>> It's only when I double click the created document, that it opens
>> in TextEdit, rather than my application.
>>
> Is one of your RB programs creating this file? If so did you set
> the MacCreator and MacType of the file when it was created.
> Something like:
>
> f.MacCreator=kMacCreator
> f.MacType=kMacType
>
> Where constants, in this case, are being used to assign the proper
> values to the two properties.
>

And also check your App Properties pane to make sure that the
AcceptFileTypes and MacCreator entries are correct.

Jack
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Double clicking created app file, opens in wrong program
Date: 12.02.06 20:22 (Sun, 12 Feb 2006 19:22:22 +0000)
From: Mark Cooke
Hi,

Thanks for the advise, i've added those two lines to my save method
and it does not seem to make any difference,
double clicking on the document still opens up in TextEdit.

If it helps here are my settings:

FileType:
Display Name: Personal Money Bank Document
Object Name: PersonalMoneyBankDocument
macType: TEXT
MacCreator: Pmbk
Extension: pmb

My Constants:
kMacType = TEXT
kMacCreator = Pmbk

App Properties:
MacCreator: Pmbk
AcceptFileTypes: FileTypes.PersonalMoneyBankDocument

Heres the saving code method:

Document as FolderItem
If Document = Nil or DisplaySaveDialog then

Dim sDialog as SaveAsDialog

sDialog = New SaveAsDialog
sDialog.Filter = FileTypes.PersonalMoneyBankDocument
sDialog.SuggestedFileName = Title + ".pmb"

// If they have selected 'Save As', then set some document details.
if sDialog.ShowModalWithin(self) <> nil then

Document =sDialog.Result
Titleðnctions.gGetFileName(Document.Name) //window Title
gets document name
End if
End if

// Save the document.
If Document <> Nil then
Document.MacCreator=kMacCreator
Document.MacType=kMacType
mWriteAccount // This writes the XML file using TextOutputStream
End if

Help that helps

Mark

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Double clicking created app file, opens in wrong program
Date: 12.02.06 20:38 (Sun, 12 Feb 2006 20:38:31 +0100)
From: Sven E Olsson

On Feb 12, 2006, at 8:22 , Mark Cooke wrote:

> Hi,
>
> Thanks for the advise, i've added those two lines to my save method
> and it does not seem to make any difference,
> double clicking on the document still opens up in TextEdit.
>

Standard Example:

Dim f as Folderitem
Dim OutFile as TextOutputStream

OutFile = f.CreateAsTextFile
OutFile.Write myText
OutFile.close

f.MacType = "TEXT"
f.MacCreator = "Pbmk"


Sven E Olsson


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Double clicking created app file, opens in wrong program
Date: 12.02.06 20:43 (Sun, 12 Feb 2006 20:43:09 +0100)
From: Sven E Olsson

On Feb 12, 2006, at 8:38 , Sven E Olsson wrote:

>
> On Feb 12, 2006, at 8:22 , Mark Cooke wrote:
>
>> Hi,
>>
>> Thanks for the advise, i've added those two lines to my save
>> method and it does not seem to make any difference,
>> double clicking on the document still opens up in TextEdit.
>>
> Standard Example:
>
> Dim f as Folderitem
> Dim OutFile as TextOutputStream
>
> OutFile = f.CreateAsTextFile
> OutFile.Write myText
> OutFile.close
>
> f.MacType = "TEXT"
> f.MacCreator = "Pbmk"
>

Sorry!
OutFile = f.CreateTextFile

Sven E Olsson

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Double clicking created app file, opens in wrong program
Date: 12.02.06 21:40 (Sun, 12 Feb 2006 20:40:52 +0000)
From: Mark Cooke
Thanks :)

That works, that worked perfectly and I can see what i was doing wrong.

Thanks everyone for the help.

Mark

On 12 Feb 2006, at 19:43, Sven E Olsson wrote:

>
> On Feb 12, 2006, at 8:38 , Sven E Olsson wrote:
>
>>
>> On Feb 12, 2006, at 8:22 , Mark Cooke wrote:
>>
>>> Hi,
>>>
>>> Thanks for the advise, i've added those two lines to my save
>>> method and it does not seem to make any difference,
>>> double clicking on the document still opens up in TextEdit.
>>>
>> Standard Example:
>>
>> Dim f as Folderitem
>> Dim OutFile as TextOutputStream
>>
>> OutFile = f.CreateAsTextFile
>> OutFile.Write myText
>> OutFile.close
>>
>> f.MacType = "TEXT"
>> f.MacCreator = "Pbmk"
>>
> Sorry!
> OutFile = f.CreateTextFile
>
> Sven E Olsson
>
> _______________________________________________
> Unsubscribe or switch delivery mode:
> <http://www.realsoftware.com/support/listmanager/>
> Search the archives of this list here:
> <http://support.realsoftware.com/listarchives/lists.html>

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Double clicking created app file, opens in wrong program
Date: 13.02.06 02:46 (Sun, 12 Feb 2006 19:46:09 -0600)
From: Harrie Westphal

On Feb 12, 2006, at 1:38 PM, Sven E Olsson wrote:

> Standard Example:
>
> Dim f as Folderitem
> Dim OutFile as TextOutputStream
>
> OutFile = f.CreateTextFile
> OutFile.Write myText
> OutFile.close
>
> f.MacType = "TEXT"
> f.MacCreator = "Pbmk"

Sven,

As I read your reply I noticed that you are setting macType and
MacCreator after closing the file. I have gone back through a number
of my programs where I create both text and binarystream files and I
see where I place these statements between the point of obtaining the
folderitem and opening the file and it works in all of those programs.

Is there truly a preferred point in the file creation point to place
these statements? It seemed to me that you would want that
information in the folderitem before the file was created; but, I
guess, like f.name, it can occur after the file has been created.

Just curious.

=#D A Mac addict in Tennessee ==
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Re: Double clicking created app file, opens in wrong program
Date: 13.02.06 16:27 (Mon, 13 Feb 2006 16:27:17 +0100)
From: Arnaud Nicolet
Le 11 févr. 06, à 16:24, Harrie Westphal a écrit :

>
> On Feb 11, 2006, at 1:54 AM, Mark Cooke wrote:
>
>> It's only when I double click the created document, that it opens in
>> TextEdit, rather than my application.
>
> Is one of your RB programs creating this file? If so did you set the
> MacCreator and MacType of the file when it was created. Something
> like:
>
> f.MacCreator=kMacCreator
> f.MacType=kMacType
>
> Where constants, in this case, are being used to assign the proper
> values to the two properties.

Note that constants are not necessarily required. The code is often
more readable if you simply say:
f.MacCreator="ttxt"
f.MacType="TEXT"
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>