Hype Scriptability with (Script Editor) - Applescript/Javascript-for-automation


(Mark Hunte) #1

Hi,

Is there any plans on making Hype Scriptable ?


Git/ VCS with hype files
(Hans-Gerd ClaĂźen) #2

up, up, up … !

Hey @Jonathan please note @MarkHunte to be second on the list for applescript-support … so i’m not alone any more :slight_smile:


#3

What do you think Hype should do?


(Mark Hunte) #4

It’s more of what Hype allows access to do with a script library.
For a start.

New Project creation…
New Element creation,
type,
position,
colour,
size, width, height, top, left
innerHTML,
position in relation to…
class/id naming,
and other properties which are r/w.
Add actions.
New Function creation…
New Scene
Current Scene
Current Scene properties,
Current Scene Elements.
Apply to selected element/s
Apply to current document
Apply to elements with class name.
Duplicate element # times.
Import images, symbols.
New Timelines
Duplicate Timelins # times
Rename Timelines.
Add Time line Actions
Export… with properties

And so on…

Just with some of those you could for create a Project with complex forms based on external data
A complex graph from spread sheet.

Or tile elements, add ids and then add images…

property allowedTypes : {"jpg", "png"}
set fileList to {}
set theIds to paragraphs of (do shell script "cat foo.txt")

set countOfElements to count of theIds

Tell Application "Hype"


set theScene to current scene of document 1

set sceneWidth  to  theScene's width
set sceneHeight  to  theScene's height



set newWidth to sceneWidth / countOfElements

set thisLeft to 0
repeat with i from 1 to number of items in theIds

 
	tell  theScene 
		set thisElement to make new element with properties {type: rectangle, id: (item i of theIds), top: 10, width: newWidth, left: thisLeft
 end tell

set thisLeft to   thisLeft + newWidth

end repeat


end tell



tell application "Finder"
	try
		set fileList to displayed name of ((every file of (choose folder) whose name extension is in allowedTypes))
		
	on error msg
		display dialog msg
	end try
end tell
Tell Application "Hype"
	set .....

The thing is if we get enough latitude then the world is you oyster. People would come up with things that are unexpected just the same as they do with Hype itself…


(Jonathan Deutsch) #5

The party line is always that I can’t make promises and we don’t comment on future product directions ;).

That said, I have wanted the ability to at least automate exporting (though I envision this might be a command-line feature). If there are other strong use cases you have please feel free to describe them in more detail!


(Mark Hunte) #6

(Mark Hunte) #7

@DBear

something like this would be brill.

      tell Application "Hype"

tell   document 1
        set theElements  to every element whose display name contains "EN_"
        
        repeat with i from 1 to number of items in theElements
                  
              set this_item to item i of  theElements
        	set hidden of   properties of this_item to true
        
         end repeat
           end tell

         end tell

#8

I am of the opinion that instead of requesting features for the core Hype app, we get a sort of plugin system where we can use external Javascript libraries to extend the features of Hype. This would take a load off of the Hype developers and lead to more creative solutions within Hype.

We can already use external libraries, but we can’t use these libraries to add tools to hype. At least, I haven’t thought of a way to do this yet.


(Mark Hunte) #9

This may have already been requested. But it may be worth you putting a new request in for it. I have some thoughts on the plugin idea, if you do put in a request I will comment there, rather than on this thread…


(Olof Pock) #10

Any new news on that? Would love to have scriptability feature in hype to…


(Jonathan Deutsch) #11

Feel free to elaborate on use cases; this will help me figure out what automation needs with Hype will be.


#12

I would use Hype scripting to import projects from other sources. For example, I’m interested in migrating Flash and Director projects over to Hype. With scripting support, I would write an app to read an XML export from Flash/Director and then import frame by frame and assets into Hype.

That, or an open file format would do the trick.

Thanks!