Thread: Applescript Help
12-17-2011, 06:35 PM #1
- Member Since
- Dec 17, 2011
Hi. I'm a beginning applescript dude and I'd like to know something about it. I'm making this widget that can do lots of stuff. Basically it's a simple application with a control panel and this control panel will have buttons like calculator or game. These buttons will link to external scripts so my code isn't all crammed into one script for easier reading of the code. I've developed all my components. Each thing will be in a different script. I have my main/control panel script that will link to all my other separate scripts. I'd like to know how to link these scripts to the resources folder of the script. Basically so that the users will only have access to the main script, which will link to the other scripts which would be located on the resources folder when you click on show package contents. Thanks and please help.
12-18-2011, 03:25 PM #2
If you are working in Applescript Editor, then save your main controller script as a bundle, from the save as menu, in the main File menu, this brings up the save dialog box, and there is a file format drop down list, select script bundle, and click save button.
Then back in the editor you will see a bundle contents button on the right side of the Run toolbar, click this button an it will show you the contents folder of your script bundle, you can create folders here with the smaller toolbar button, and name the folders anything you like, and you can also drag any script file or resources into any of the bundle folders.
Usually scripts are kept in the scripts folder inside the contents folder, not the resources folder, the resources folder is usualy reserved for icons, media, help files, ect.
But it does not really matter.
To find the external script files from your controller script, use the path to me command, and also the path to resource command, in your main controller script.
set my_icon_file to path to resource"MyIcon.icns" in bundle (path to me) as alias
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
By EdMarx in forum OS X - Apps and GamesReplies: 0Last Post: 02-10-2012, 05:06 AM
By SgtDave in forum OS X - Development and DarwinReplies: 6Last Post: 01-19-2011, 04:50 PM
By thtguyjosh in forum OS X - Apps and GamesReplies: 8Last Post: 08-22-2010, 08:22 PM
By nixonbw in forum OS X - Operating SystemReplies: 0Last Post: 07-17-2008, 08:00 PM
By TehHero in forum OS X - Apps and GamesReplies: 0Last Post: 01-26-2008, 10:46 PM