Applecript and xcode. Simple question, unknown answer. help!
Hello,
I am completely new to XCode and have been trying to use some self-made applescript libraries for a new Applescrip-xcode app.
My question is just how to call from my main script (applescrip) the functions inside those libraries. I used to do something like this (and works fine) when using applescript editor:
set library_file to "pathtolibFolder:myLibrary.scpt"
set myLibrary to (load script file (library_file))
set aVariable to aFunction() of myLibrary
This code (I think obviously) does not work in xcode, and I think there should be somewhere something like:
#include "myLibrary.scpt"
Those self-made-libraries are already compiled and have been imported (non .applescript but .scpt), de-compiled and re-compiled by xcode correctly (no errors), but I don't know where I have to put the connections to those libraries in my project. I'm sure the answer is simple but I'm unable to find it by myself.
Thanks!
Message was edited by: rampol
Replying myself... I think I've found the answer, not yet tried but looks nice. I post (paste) it here cos it might be useful to someone. I'll let you know if that works:
How could I include an applescript as its own ASOC class?
It's pretty straightforward. In XCode, Make a new file ... class... ASOC.
And you can basically paste in your applescript into the middle of the file that is created. Make sure that you change the names of any handlers you want to call from outside the class into ASOC methods by adding an underscore between name and parentheses; i.e. from doThething() to doTheThing_()
A typical applescript handler:
property aProperty : "a string"
global aGlobal
on doTheThing(withThis)
return retVal
end doTheThing
as its own ASOC class:
script aScriptClassName
property parent : class "NSObject"
property aProperty : "a string"
global aGlobal
on doTheThing_(withThis)
return retVal
end doTheThing_
end script
Then, to call the methods in your new ASOC class from another ASOC class, the easiest thing to do is add your new class to your application's Interface Builder NIB and connect it to a property in the ASOC class you want to call your methods from.
property myOtherClass : missing value
myOtherClass's doTheThing_(itsInput)
-------------------------------------------------
Similar Messages
-
my password
i have another account and my ipad with this account and the password i forget it and the reset question help me my ipad need active to open and i know my account name
-
JSP and JavaBean simple question, pls help
Hello,
I am new to JSP. I just installed Sun Java Studio Enterprise 8 to create a JSP project. I created a jsp file and java class file in the same project. the class file is in default package. I use <jsp:useBean id="date" class="DateFormatBean"/> in jsp file to call the java class. When I run the jsp page I got the error:
cannot resolve symbol
symbol : class DateFormateBean
if I add a package in the class file, I got the error: package com.mycom.projsp does not exist.
Also I tried to add a jar file into the library and tried to import it in my jsp page, I also got package doesn't exist error.
I know I need to set the classpath and I did it, but still got the error. Could someone help me out? Do I miss some settings? I am using Tomcat.
Thanks in advance!i'm not familiar with Java Studio Enterprise 8 so i'm not sure how it is organizing its project. However, i know tomcat...and if for test purposes you take your jsp file and put it in $TOMCAT_HOME/webapps/ROOT and your class file and put it in $TOMCAT_HOME/webapps/ROOT/WEB-INF/classes, things should work out. perhaps the web app isn't being organized properly in your tool.
hope that helps. -
A few simple questions i need help on please
i have an ipod mini. my computer crashed and i have a new computer. is there a way to upload my songs and lists to the computer? i have itunes 7.0.
second question. is there a way to upload only one or two songs to an ipod mini that is already loaded with songs, without uploading all the songs again. is the current info automatically overwritten so that i would end up with only the two songs on the ipod after uploading?
thanks in advance.
bobis there a way to upload my songs and lists to the computer?
Maybe. You say your old computer crashed. Does that mean it doesn't run at all? Does it mean it hangs during the boot-up process? Does it mean the hard drive came to a crashing screeching halt? Without knowing more about the death of the old computer none of us can know whether the data is recoverable or not.
OTOH, you have at least part of your music data on your iPod. So with the help of third party software (check out your favorite download site) you'll be able to transfer your iPod's music and playlists to the new computer. If the iPod contains your entire music collection you are pretty much good to go.
Can you add only a couple songs to your iPod? Sure, after connecting it to your new computer you'll be told it is synced to another computer and asked if you want to sync it to this new one. Select cancel - no you don't want to sync it to the new one. After the iPod appears in iTunes select it and in the iPod preferences select manually manage. This will let you manually add or delete songs. -
IPod Touch vs iPod Classic Syncing. Simple question, Any answers?
I have an iMac G4 running Leopard and a new Mac Mini Intel running Snow Leopard. Here is my connection issues:
1) My iPod classic syncs to both computers.
2) My iPod Touch (running OS 4.0) syncs to my iMac but not the Mac Mini.
Why?
There has to be a simple solution, but I haven't seen one. I've tried all of the solutions posted here for the Touch, but none work.Your mini needs to be running iTunes 9 to start. The touch syncs via a piece of software called Apple Mobile Device Services, the classic does not use this.
These two tech articles will help you solve the problems you are having with AMDS on your mini:
http://support.apple.com/kb/HT1747
and if you need to remove and reinstall iTunes http://support.apple.com/kb/HT1224
If you are connecting through a USB hub, try connecting directly to the mini until you get this sorted out. If you are going to use a hub, it needs to be powered. -
I am getting a new imac in a couple of days, i aready have the 4gb of ram. The question is should i install it first, before i even turn on the imac????
is there a site or directions that tells you how to install ram??It's a pretty simple procedure. The HOW can't be explained any better than in your little manual.
You should run it for a few days (or at least hours) to make sure everything works properly, with the original RAM. Try everything, stress it a bit by running multiple programs, like an iTunes video podcast at the same time as playing a QuickTime HD movie trailer. Once you are satisfied everything is working fine, then upgrade the RAM. -
Router and range booster question. PLEASE HELP! :(
Okay so I used to use the WRT54G router and since I upgraded to a new WiFi router / modem I don't need to Linksys one anymore. Well my neighbors aren't getting a very good signal and I managed to find an old WRE54G Range Booster in a box. Well my question is that if I set up the WRT54G router and Range Booster at their house would they be able to have a stronger signal if trying to connect to my new WiFi router? Oh its a HUAWEI, this seems like a pretty easy question and I'm guessing it wont work but I am just wonder like what are my options here to get them a better signal with these 3 components. Thanks!
Solved!
Go to Solution.You can certainally try the WRE in their house but 1 bar may not be enough to repeat the signal throughout their house.
Another thing you can try is to try and position the WRE somewhere in your house that is as close as possible to their house and aim the antenna towards their house.
As I recall I think the V3 version of the WRE has an ethernet port underneath a cap on top (I don't think V1 and V2 had one) but I believe that it was only intended for setting up the range extender. If you can get a sufficient wireless signal into their house I think you would have to have their laptop connect wirelessly to the WRE. -
Simple question but urgent help needed....
I am using Sqlplus i need help on one query. I have got table with 34,000 rows and i would like to findout the frequency frm that table...can anyone help me plz how shud i do it?
I have all this field in my table ( PROD_ID CUST_ID TIME_ID PROMO_ID QUANTITY_SOLD AMOUNT_SOLD)
I need to find out the frequency for quantity sold column can some1 help me plz.
Message was edited by:
user562879SQL> create view v as select column_value as item from table(integer_tt(17, 17, 14, 16, 15, 24, 12, 20, 17, 17, 13, 21, 15, 14, 14, 20, 21, 9, 15, 22, 19, 27, 19));
View created.
SQL> select * from v;
ITEM
17
17
14
16
15
24
12
20
17
17
13
21
15
14
14
20
21
9
15
22
19
27
19
23 rows selected.
SQL> @count item v
ITEM TOTAL %
9 1 4
12 1 4
13 1 4
14 3 13
15 3 13
16 1 4
17 4 17
19 2 9
20 2 9
21 2 9
22 1 4
24 1 4
27 1 4
13 rows selected.
SQL> @cardinality item v
Occurrences Groups with this cardinality Total rows Proportion
1 7 7 30
2 3 6 26
3 2 6 26
4 1 4 17
23 100
4 rows selected. -
Simple Question--hard answer?
This should not be that hard, so I'm guessing I'm just blind. Someone emails me a stupid, funny song/ad/random mp3. I click on it. Its added to my iTunes library. Why? What makes iTunes think I want to add EVERY mp3 I double click on to my iTunes library? I don't need the file stored twice--once in my email, once in my library.
Where is the setting to turn off this irritating behavior? Its like there is an invisible Clippy, saying, "I see you have clicked an mp3. I've gone ahead and added it to your library. You're welcome!"That's not what I want though--I DO want it to copy to my folder when purposefully adding to my library.
Right now, double click = add to library.
I want is double click to equal "play", and then, if i actually like the song I'm listening to that is say, on my desktop, to go to iTunes File|Add to Library, browse to that song and then have it add to my library, copying it to my music folder.
My workaround is just to set Real Player as my default mp3 player, but I would rather not do that. -
Copy FLASH to USBFLASH0...Simple Question need answered
I would like to copy all folder/files from flash to usbflash. When I receive a new router to configure, I would like to use my usb-stick to copy everything from flash, including that ccpexp folder with many sub-folders, to my usb. Can someone assist with how to perform or options?
Ah...I tried that several times with nno luck. This should be an easy thing to due. I know someone will tell me to use ftp or tftp but I really don't think I have to if the router has a usb port. Doing files individualy will work, but if a router has many files in flash then a simple COPY command should be enough. Am I missing something?
-
FileVault and TimeMachine simple question
I have a mid-2009 15" MBP running Mavericks, with an external TimeMachine volume.
I recently turned on FileVault. Everything seems to be working.
What I can't figure out and can't find, is whether the TM volume was also encrypted at the same time.
Obviously if it's not, this is not a good thing, and I'd want to encrypt it as well.
If it's not, then, can I tell FileVault to do it, and how do I do that?
If you can point me at a relevant bulletin I will be happy.
TIAWhat I can't figure out and can't find, is whether the TM volume was also encrypted at the same time.
It wasn't.
If it's not, then, can I tell FileVault to do it, and how do I do that?
Choose a backup disk and set encryption options -
Simple Question, need answer please!
Hi,
I've simply forgotten how to select part of a track in Garageband?
I've imported a 4 minute track and need to select 30 seconds of it in the middle somewhere. I done it yesterday, it highlighted smaller yellow boxes along the top of the track but i cannot get it to show this time!
Answer appreciated!Don't worry, I found it!
-
Mic Ro Phones [and if your questions r answered final iZe them]
I bought a Griffin iTalk but it is not for 60gigVideo. Can I use a normal mic. to record voice? I looked all over the place before posting so here is my turn. [thank you to all the "answerers" for taking the time with us not yet knowledgable ones]>Custom Built Windows XP Pro AMD 3000+ Sempron - 200 gig HDD - 1 gig Ram - 512 mg Graphics - FX128 Sound - WiFi DSL - 60 gig Video iPod
Custom Built Windows XP Pro AMD 3000+ Sempron - 200 gig HDD - 1 gig Ram - 512 mg Graphics - FX128 Sound - WiFi DSL - 60 gig Video iPodhi drippy [that's me] I found a place, well much more than a place, it is a gold mine for my request, go to "extrememac.com". Not only do they have a great mic. but some of the coolest covers I've seen to date. I have'nt gotten it yet but will update when they ship this spring.
Custom Built Windows XP Pro AMD 3000+ Sempron - 200 gig HDD - 1 gig Ram - 512 mg Graphics - FX128 Sound - WiFi DSL - 60 gig Video iPod -
Why does this site have online chat when you can never actually chat - always "not available"? I was trying to get a simple question answered without calling and being on hold for 10 minutes?
Hello flabucki,
Help is just a post away for you my friend! I can help with your questions right here. May I ask what question do you have? Both myself and the community would love to assist in any way that we can.
Thank you…
ArnettH_VZW
Follow us on Twitter @VZWSupport -
Hi can anyone help me with the solution to get my security questions and answers re-set?
I have done everything the site asks you to do/ reset passwords/ confirm re-send mail and so on BUT the site still does a 360 back to answer security
questions to confirm your identity....that is the point -I do not rememeber the questions and certainly therefore dont remember answers to questions that I am supposed to recall....so what do I do?
For the last 8 months ++ I've gone full circle and am at my wits end?
Anyone have some deep wisdom on this issue
Thanks and regardsAlternatives for Help Resetting Security Questions and Rescue Mail
1. Apple ID- All about Apple ID security questions.
2. Rescue email address and how to reset Apple ID security questions
3. Apple ID- Contacting Apple for help with Apple ID account security.
4. Fill out and submit this form. Select the topic, Account Security.
5. Call Apple Customer Service: Contacting Apple for support in your
country and ask to speak to Account Security.
How to Manage your Apple ID: Manage My Apple ID
Maybe you are looking for
-
I am trying to install iOS 7.1.1 but it keep asking me for a passcode what is that? It is not accepting my Apple ID
-
Very bad signal on iPhone 4 after upgrade to IOS 6
After upgrading my iPhone 4 from IOS 5.1.1 to IOS 6, I started having lot of troubles with signal and signal strength: the phone is continuously switching form 3G to GPRS/Edge, signal strength is always bad, Internet access is almost unusable, and so
-
Server 2008 R2 - Metafile Cache Memory Consumption...
This question is related to posting http://social.technet.microsoft.com/Forums/en-US/winservergen/thread/7b49424d-08c1-4fc4-bc9a-3569ab978efe, the final comment in the thread reading: "I ended up opening a ticket with Microsoft. It was indeed the ex
-
How add buttons to Jframe from other class
Hi, a have a little problem;) I want make a JFrame, but i want to add JButtons from other class. Now I have something like that: My JFrame class: package windoow; import javax.swing.*; import java.awt.*; public class MyWindow extends JFrame {
-
Bridge CS3 just freezes when I open it. Simply just will not navigate and the icons appear only partly. Running OS X 10.5.6 on a G5. Bridge v2.1.1 (have done updates for both) This was running no problem then I replaced a crashed hard drive and had t