Results 1 to 2 of 2

Thread: Applescript Help

  1. #1

    Member Since
    Dec 17, 2011
    Applescript Help
    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.

  2. #2

    Mark FX's Avatar
    Member Since
    Aug 13, 2011
    West Sussex, UK
    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.

    for example

    set my_icon_file to path to resource"MyIcon.icns" in bundle (path to me) as alias
    hope this helps

    Regards Mark

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Applescript
    By EdMarx in forum macOS - Apps and Games
    Replies: 0
    Last Post: 02-10-2012, 05:06 AM
  2. Applescript
    By SgtDave in forum macOS - Development and Darwin
    Replies: 6
    Last Post: 01-19-2011, 04:50 PM
  3. Applescript help please?
    By thtguyjosh in forum macOS - Apps and Games
    Replies: 8
    Last Post: 08-22-2010, 07:22 PM
  4. Applescript
    By nixonbw in forum macOS - Operating System
    Replies: 0
    Last Post: 07-17-2008, 07:00 PM
  5. AppleScript
    By TehHero in forum macOS - Apps and Games
    Replies: 0
    Last Post: 01-26-2008, 10:46 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts