Monday, December 11, 2017

#26 2009-11-03 06:42:32 pm

pppfff
Member
From:: Freiburg, Germany
Registered: 2009-10-31
Posts: 22

Re: I love Apple, but they messed up big...

wow, that was very quick!
And I see now the text. Great!
If the text is longer than the text box I am able to scroll.

It is not scrolling automatically from left to right.
I guess I have to show you what I want to do.
Will create some pictures and post it here.

Very very good forum here !

THANK YOU, Richard, Shane, Craig and all!
pppfff

Offline

 

#27 2009-11-03 07:29:16 pm

Richard
Member
From:: Herefordshire, UK
Registered: 2009-09-09
Posts: 529
Website

Re: I love Apple, but they messed up big...

Or a link to the zipped project folder, you have Mobile Me? Or any file sharing site.

Offline

 

#28 2009-11-04 06:11:32 pm

pppfff
Member
From:: Freiburg, Germany
Registered: 2009-10-31
Posts: 22

Re: I love Apple, but they messed up big...

Yes, I have MobileMe and I am just uploading a screenshot movie to demonstrate what the application is doing.
The movie is 36 MB and my upload speed is very very slow. It takes 20 minutes, could be even more and it is quite late here in Germany.
Tomorrow I will post the link to my public MobileMe folder.
Next step is then to upload the zipped project folder.
Sorry for the delay.
best regards
pppfff

Offline

 

#29 2009-11-05 02:49:03 pm

pppfff
Member
From:: Freiburg, Germany
Registered: 2009-10-31
Posts: 22

Re: I love Apple, but they messed up big...

OK,
here the link to the demonstration how the application is working:
Video

And inside the application I have written:

-- Have used two Applescripts as "templates" to realize this application

--    No 1
(*
    Applescript Code for this Image View is mainly
    from:
    "Art to Desktop" for iTunes
    written by Doug Adams
    dougadams@mac.com
    v2.1 sept 10 2009
    -- updated for Snow Leopard compatibility
    -- enhancements and finesses
               
    (there are additions from myself, to view all images in the artist folder as well)
    *)
--
--    No 2
(*
    db iTunes Fade-and-Advance
    By David Battino, Batmosphere.com
    Version 2009-03-03JJ
    Based on ideas from Doug's AppleScripts and Mac OS Hints

    See www.oreillynet.com/mac/blog/2007/03/itunes_fadeout_script.html for background

    or
    http://broadcast.oreilly.com/2009/05/it … de-to.html

    This script fades out iTunes if it's playing and then plays the next song.
    If iTunes is paused, the script will start playback.
    *)

(*
And here I have found very good tipps & tricks

    Slider Control
    Mouse Control
    Color control

http://www.bynkii.com/archives/mac-os-x-scripts/2009/

Craig Williams has created 5 very good tutorial about the new Xcode Applescript

http://macscripter.net/viewforum.php?id=31

Infos about the Idle Function you will find here:
http://discussions.apple.com/thread....7699&tstart=45


And here the link where I have found how to display a picture:
http://macscripter.net/viewtopic.php?id=30462


The buttons have been designed and created by myself with Photoshop 6.0

*)


And again I have a question:
How is it posssible to this text in the ABOUT or HELP popup, to give credit to all who has helped?

best regards
pppfff

Last edited by pppfff (2009-11-06 04:09:34 pm)

Offline

 

#30 2009-11-05 04:04:41 pm

Richard
Member
From:: Herefordshire, UK
Registered: 2009-09-09
Posts: 529
Website

Re: I love Apple, but they messed up big...

I don't know how but you could too easily add a credits item to the app name menu with a window with a text view.

Offline

 

#31 2009-11-05 05:41:53 pm

pppfff
Member
From:: Freiburg, Germany
Registered: 2009-10-31
Posts: 22

Re: I love Apple, but they messed up big...

Hi Richard,
yes, that was my thought as well, but I wanted to have it "professional"  :-)

Here the link to project source code.
Zipped Project Files

You need to have jpg or png pictures in the iTunes artist folder.
If it is a compilation then it is looking in the artist folder as well.
If you press the button "Open/create Artist folder ..." then the finder is checking if such a folder exists.
If yes, it opens this folder. If no, it creates such a folder.
Then Safari is searching for the artist name in google pictures medium size.
Now you can open the full size picture and drag it to the artist folder.
Update: Goal is to automate that step. With a confirmation step to make sure the picture is the the right one.

The skip forward button with an S skips to the selected song in iTunes.
All the other buttons fade in and out to the next or previous song.

Have fun and please give feedback!

best regards
pppfff

Last edited by pppfff (2009-11-06 04:12:16 pm)

Offline

 

#32 2009-11-05 05:45:58 pm

Shane Stanley
Member
From:: Australia
Registered: 2002-12-07
Posts: 5197

Re: I love Apple, but they messed up big...

pppfff wrote:

How is it posssible to this text in the ABOUT or HELP popup, to give credit to all who has helped?


Save the info in a file called Credits.html, Credits.rtf or Credits.rtfd, and add the file to your project. It will appear in the About box automatically.

Last edited by Shane Stanley (2009-11-05 05:46:19 pm)


Shane Stanley <sstanley@myriad-com.com.au>
www.macosxautomation.com/applescript/apps/

Offline

 

#33 2009-11-05 06:23:18 pm

pppfff
Member
From:: Freiburg, Germany
Registered: 2009-10-31
Posts: 22

Re: I love Apple, but they messed up big...

Shane,
thank you !  After some trys and errors it worked.
Have created the file in pages and exported it in rtf format.
Then I dragged it into the project under "resources".

:-)
pppfff

Offline

 

#34 2009-11-05 06:52:50 pm

Richard
Member
From:: Herefordshire, UK
Registered: 2009-09-09
Posts: 529
Website

Re: I love Apple, but they messed up big...

Wow thanks Shane, when you mentioned that I suddenly remembered something about it in the document template.

Offline

 

#35 2009-11-05 07:07:56 pm

Richard
Member
From:: Herefordshire, UK
Registered: 2009-09-09
Posts: 529
Website

Re: I love Apple, but they messed up big...

pppfff,

The script will not compile, it wants an end of line where there is a quote next to growl, this isn't my script, and I think this section isn't yours XD, these problems can be quite complicated if you don't know the script inside out, especially one... how big?... that's double my finished Dialog Maker class, I'm clueless, do you know what's wrong? You sound as if you have a working copy.

Edit: do I need an app? I see tell and something with growl in it.

Last edited by Richard (2009-11-05 07:11:19 pm)

Offline

 

#36 2009-11-06 01:05:18 pm

pppfff
Member
From:: Freiburg, Germany
Registered: 2009-10-31
Posts: 22

Re: I love Apple, but they messed up big...

Sorry Richard,
have added variable which controls if GROWL is active or not and I have set it to inactive.
So you do not need this little information apps.
I understand only 10% of your email, but I hope it solves the issue.

Please try again to download.

best regards
pppfff

Offline

 

#37 2009-11-06 01:08:48 pm

Richard
Member
From:: Herefordshire, UK
Registered: 2009-09-09
Posts: 529
Website

Re: I love Apple, but they messed up big...

Sorry I post late at night sometimes when my head is in a mess.

Offline

 

#38 2009-11-06 01:13:29 pm

Richard
Member
From:: Herefordshire, UK
Registered: 2009-09-09
Posts: 529
Website

Re: I love Apple, but they messed up big...

I'm afraid it still happens in this area:

Applescript:

if isRunning then
                   tell application "GrowlHelperApp"
                       -- Make a list of all the notification types that this script will ever send:
                       set the allNotificationsList to ¬
                           {"Song Notification"}
                       
                       -- Make a list of the notifications that will be enabled by default.
                       -- Those not enabled by default can be enabled later
                       -- in the 'Applications' tab of the growl prefpane.
                       set the enabledNotificationsList to ¬
                           {"Song Notification"}
                       
                       -- Register our script with growl.
                       -- You can optionally (as here) set a default icon
                       -- for this script's notifications.
                       register as application ¬
                           "Growl Song ID" all notifications allNotificationsList ¬--error is first quote of this line, have you complied this yourself?
                           default notifications enabledNotificationsList ¬
                           icon of application "iTunes"
                   end tell
               end if
               
           end if

If I comment it outI get a similar error here (line 1047):

Applescript:

if nActiveGrowl = 1 then
                               if isRunning then
                                   tell application "GrowlHelperApp"
                                       
                                       notify with name "Song Notification" title "Now Playing . . ." description "'" & theSong & "'" & " by '" & theBand & "'" application name "Growl Song ID"
                                       
                                   end tell
                               end if
                               
                           end if

Same again with similar 40 lines down.
Another same as the first around 1166
The list is endless, it seems this app almost solely depend on this GrowlHelperApp and these 2 patterns (he should have subroutined these for definite), Xcode cannot recognise these app specific lines without it either.

Last edited by Richard (2009-11-06 01:24:56 pm)


Filed under: GrowlHelperApp

Offline

 

#39 2009-11-06 01:31:35 pm

Richard
Member
From:: Herefordshire, UK
Registered: 2009-09-09
Posts: 529
Website

Re: I love Apple, but they messed up big...

Also you have multiple of the same subroutine skipToNextSong_(sender)

Offline

 

#40 2009-11-06 01:31:46 pm

pppfff
Member
From:: Freiburg, Germany
Registered: 2009-10-31
Posts: 22

Re: I love Apple, but they messed up big...

Richard,
Growl is a system information application, used by a lot of applications like cyberduck, forklift, Western Digital Backup, just to name the ones I am using.

Is it possible for you to delete the lines completely?

Wait, I comment it out.

Just a minute or two. 

Update: Done, I have surrounded it with (* *) and uploaded it again.
It is the first time I am sharing a Mac application, so I could expect such issues. Sorry!

best Regards
pppfff

PS: Last months I was in Hatfield UK for 3 weeks. It is in Herefordshire as well.  :-)

Last edited by pppfff (2009-11-06 01:44:48 pm)

Offline

 

#41 2009-11-06 01:33:50 pm

Richard
Member
From:: Herefordshire, UK
Registered: 2009-09-09
Posts: 529
Website

Re: I love Apple, but they messed up big...

I already did, that's how I found your multiple subroutine error.

Offline

 

#42 2009-11-06 01:46:42 pm

pppfff
Member
From:: Freiburg, Germany
Registered: 2009-10-31
Posts: 22

Re: I love Apple, but they messed up big...

hmmh,
then it will not help that I have done it as well.
And I do not have errors.

Is it running now ?

Offline

 

#43 2009-11-06 01:59:25 pm

StefanK
Member
From:: St. Gallen, Switzerland
Registered: 2006-10-21
Posts: 11482
Website

Re: I love Apple, but they messed up big...

Richard wrote:

Edit: do I need an app? I see tell and something with growl in it.


Richard,

if Growl is not installed on your machine, the script won't compile because of the lack of GrowlHelper.app
Growl is not a part of OS X.


regards

Stefan

Offline

 

#44 2009-11-06 02:01:51 pm

pppfff
Member
From:: Freiburg, Germany
Registered: 2009-10-31
Posts: 22

Re: I love Apple, but they messed up big...

Thank you Stefan,
is there a way to make it universal ?
For users with Growl and without ?

Or is it only an issue when you compile it new ?

best regards
pppfff

Offline

 

#45 2009-11-06 02:11:05 pm

StefanK
Member
From:: St. Gallen, Switzerland
Registered: 2006-10-21
Posts: 11482
Website

Re: I love Apple, but they messed up big...

for a pure AppleScript solution Growl must be installed on the developing machine to be able to compile the script.

But there are two workarounds:

• use a precompiled script including the Growl part, which can be loaded in case Growl is installed.
• use Growl.framework with an ObjC class which can be called by the script.

Actually the second way is not a workaround, it's the best solution and quite easy to realize


regards

Stefan

Offline

 

#46 2009-11-06 02:20:44 pm

pppfff
Member
From:: Freiburg, Germany
Registered: 2009-10-31
Posts: 22

Re: I love Apple, but they messed up big...

Stefan,
both options are over my current level of experience.
I have just started to use Applescript and Xcode and Mac in general.

Could say some more words about solution 2, the easy one

:-)
pppfff

Offline

 

#47 2009-11-06 02:48:28 pm

Richard
Member
From:: Herefordshire, UK
Registered: 2009-09-09
Posts: 529
Website

Re: I love Apple, but they messed up big...

Stefan, yes that's what I was pointing out.

pppfff, I wouldn't have jumped in so deep anyway, think small aim big, try testing out, menu items, dock menu, simple cocoa. I started off taking existing scripts I had and replacing dialogs with text fields, one being dialog maker, it used to be a text view, text field and a pair of radio buttons, it has gone really well. At least less than 1000 lines lol and perhaps not so 3rd party dependant?

Last edited by Richard (2009-11-06 02:48:56 pm)

Offline

 

#48 2009-11-06 03:00:14 pm

pppfff
Member
From:: Freiburg, Germany
Registered: 2009-10-31
Posts: 22

Re: I love Apple, but they messed up big...

Hi Richard,
this is my first project and I have just copied the whole script for fading in and out 4 times.
For each button one time.

It is not too difficult to streamline the applescript part.

My focus was and still is  to start with Xcode and find out how it is working.
I agree 100% that this is quick and dirty programming :-)

And for me it is much more fun if I can realize some good looking nice application which can be used every day while I am playing music on my mac.

What have you changed and what is better now ?

best regards
pppfff

Offline

 

#49 2009-11-06 03:20:56 pm

StefanK
Member
From:: St. Gallen, Switzerland
Registered: 2006-10-21
Posts: 11482
Website

Re: I love Apple, but they messed up big...

pppfff wrote:

Could say some more words about solution 2, the easy one


OK,

quick tutorial

1) Download Growl SDK1.2 from here
2) Mount the .dmg and move the folder ./Growl 1.2 SDK/Frameworks/Growl.framework into your project folder
3) In Xcode highlight Frameworks/Other Frameworks
4) From the Action menu choose Add > existing frameworks
5) in the dialog box goto your project folder and select Growl.framework
6) Click Add (twice)
7) From the Action menu choose Add > New Build Phase > New Copy Files Build Phase
8) In the Dialog Box choose Frameworks from the popup menu
9) Close the Dialog Box
10) in the sidebar open the triangles of Targets and [NameOfYourApp]. You will see a rectangle "Copy Files"
11) Drag the icon of Growl.framework (in Frameworks/Other Frameworks) onto "Copy Files". After success you will see "Copy Files (1)"
12) Highlight the top element in the side bar
13) From the Action menu choose Add > New Group
14) Type Classes and return
15) Highlight the Classes group folder
15) Choose Menu File > New File
16) select Cocoa > Objective-C class, click Next
17) Type GrowlNotify, click Finish

18) Replace the contents of  GrowlNotify.h with
[code]#import <Cocoa/Cocoa.h>
#import <Growl/Growl.h>


@interface GrowlNotify : NSObject <GrowlApplicationBridgeDelegate> {
}

+ (id)sharedInstance;

- (NSDictionary *) registrationDictionaryForGrowl;
- (BOOL)growlIsInstalled;
- (void)growlNotify:(NSString *)msg title:(NSString *)title;

@end[/code]
19) Replace the contents of  GrowlNotify.m with
[code]#import "GrowlNotify.h"

@implementation GrowlNotify

+ (id)sharedInstance
{
    static id sharedTask = nil;
    if(sharedTask == nil) {
        sharedTask = [[self alloc] init];
    }
    return sharedTask;
}

- (id)init
{
    [GrowlApplicationBridge setGrowlDelegate:self];
    self = [super init];
    return self;
}

- (BOOL) growlIsInstalled
{
    return [GrowlApplicationBridge isGrowlInstalled];
}

- (NSDictionary *) registrationDictionaryForGrowl
{
    // NSLog(@"Register Growl");
    NSArray *notifications;
    notifications = [NSArray arrayWithObject:@"Song Notification"];
   
    NSDictionary *dict;
    dict = [NSDictionary dictionaryWithObjectsAndKeys:
            notifications, GROWL_NOTIFICATIONS_ALL,
            notifications, GROWL_NOTIFICATIONS_DEFAULT, nil];
   
    return dict;
}

- (void)growlNotify:(NSString *)msg title:(NSString *)title
{
    //  NSLog(@"growlNotify");
    [GrowlApplicationBridge     notifyWithTitle:title
                                 description:msg
                            notificationName:@"Song Notification"
                                    iconData:nil
                                    priority:0
                                    isSticky:NO
                                clickContext:nil];
}

@end[/code]
20) in the AppleScript part, you need these elements

Applescript:


property GrowlInstance : missing value
property GrowlIsInstalled : false

on awake from nib theObject
set GrowlInstance to call method "sharedInstance" of class "GrowlNotify"
set GrowlIsInstalled to (call method "growlIsInstalled" of GrowlInstance) as boolean
if GrowlIsInstalled then
call method "growlNotify:title:" of GrowlInstance with parameters {"Now Playing . . .", "my Favourite Song"}
end if
end awake from nib

on will quit theObject
call method "release" of GrowlInstance
end will quit

You can download a sample project here

Last edited by StefanK (2009-11-06 03:56:20 pm)


regards

Stefan

Offline

 

#50 2009-11-06 04:18:03 pm

pppfff
Member
From:: Freiburg, Germany
Registered: 2009-10-31
Posts: 22

Re: I love Apple, but they messed up big...

Wow, I am impressed !
These are more than just a few words. It is enough work for a long weekend.
:-)
pppfff

PS: And you helped me to to enter a link in the right way. Thank you!

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)