Hey All,
So I added my custom ext in the Info.plist settings for my app and now when I double click a file with that extension it opens up my app that is associated with that extension. My problem is I can't seem to figure out how to get the filename of the file that was double clicked. On pc you can just get it with $1 but what do I need to do to access it on MAC?
Double click file to open it in app on MAC
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 86
- Joined: Tue May 15, 2012 5:56 pm
-
- VIP Livecode Opensource Backer
- Posts: 10058
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Double click file to open it in app on MAC
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
-
- Posts: 86
- Joined: Tue May 15, 2012 5:56 pm
Re: Double click file to open it in app on MAC
Thanks for the input fourthworld but my issue was not setting the file association on mac which you can do in the standalone application settings for mac. I was having issues getting the file name of a file I double clicked on to open it. i solved my issue with some code someone provided in the contributor notes of the livecode dictionary.
Code: Select all
on appleEvent theClass,theID
if theClass is "aevt" and theID is "odoc" then
request appleEvent data
put it into theFiles ## files OS is requesting your application opens, one per line
if theFiles is not "not found" and theFiles is not empty then
## code to open theFiles
end if
else
pass appleEvent
end if
end appleEvent
-
- VIP Livecode Opensource Backer
- Posts: 10058
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Double click file to open it in app on MAC
Glad you found the solution. I've dropped a note to the author of the article I linked to, suggesting he include an example appleEvent handler to make that discussion more complete.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn