launch a stack from a file

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
adventuresofgreg
Posts: 349
Joined: Tue Oct 28, 2008 1:23 am
Contact:

launch a stack from a file

Post by adventuresofgreg » Wed Nov 14, 2012 10:54 pm

I'm interested in a way to launch a standalone by double clicking a data file (which is just a text file that the standalone generated). This would be akin to double clicking on a Microsoft Word file to launch Microsoft word application, and then open the file.

In my case, the text file is a dump of the contents of all fields, and state of all buttons, and global variables. Currently, I launch my standalone, then "open" the exported data file. What I would like to do, is to be able to double click on the data file, and open it, in one step. Previously, I have accomplished something close to this by changing the name of my standalone. When launched, the stack looks at it's name and loads in a datafile with the same name. There are limits with this, as you can't save files where ever you want, and you can't name them however you want without specifying that in the original app.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10058
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: launch a stack from a file

Post by FourthWorld » Thu Nov 15, 2012 12:30 am

Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

adventuresofgreg
Posts: 349
Joined: Tue Oct 28, 2008 1:23 am
Contact:

Re: launch a stack from a file

Post by adventuresofgreg » Thu Nov 15, 2012 1:17 am

Thanks Richard. I was thinking about this and I think I came up with a way that might work for me. I could launch an instance of my standalone in a folder, and have the stack automatically look for a file in the folder the app was launched from that has the extension *.MYapp (or whatever), and load that. If no data file exists, then the app opens to a default. The only issue with this, is I have support files like audio clips that need to get played from the default folder. If I launched multiple instances of my app - each from different folders opening different data files, I would need to copy the sound clips into each folder... Actually, I could set the default folder down one folder level... that could work

Post Reply