Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

haravikk

macrumors 65832
Original poster
May 1, 2005
1,504
26
This is related to Flash player, but basically to have multiple files open in Flash Player quickly decimates its performance as it seems to thread extremely poorly.

However, this can be easily circumvented by either opening files in other programs that use the Flash plugin (such as browsers), or simply copying the Flash Player app a few times and dragging each file onto a different one to open multiple copies.

Now, while the latter is the better option IMO, it's messy and you need to recreate the copies any time the Flash Player is updated.

What I'm wondering is if it would instead be possible (perhaps via a script assigned as the .swf file type handler) to open a new copy of Flash Player every time a .swf file is opened, and hand the file to the new copy, instead of simply opening new files in an existing copy.

Don't suppose anyone has any ideas as to how this would be done? I've wrestled with assigning a script container to a file-type before and it is possible (with a bit of work), but opening a single copy of an app multiple times is something I don't know how to do.
 
This is related to Flash player, but basically to have multiple files open in Flash Player quickly decimates its performance as it seems to thread extremely poorly.

However, this can be easily circumvented by either opening files in other programs that use the Flash plugin (such as browsers), or simply copying the Flash Player app a few times and dragging each file onto a different one to open multiple copies.

Now, while the latter is the better option IMO, it's messy and you need to recreate the copies any time the Flash Player is updated.

What I'm wondering is if it would instead be possible (perhaps via a script assigned as the .swf file type handler) to open a new copy of Flash Player every time a .swf file is opened, and hand the file to the new copy, instead of simply opening new files in an existing copy.

Don't suppose anyone has any ideas as to how this would be done? I've wrestled with assigning a script container to a file-type before and it is possible (with a bit of work), but opening a single copy of an app multiple times is something I don't know how to do.

Take a look at the man page for the open command, in particular the -n option.
 
Ah, that did the trick!

For those interested then, here's the script I used:

Code:
source ~/.profile
APP="/Applications/Adobe Creative Suite 5/Adobe Flash CS5/Players/Flash Player.app/Contents/MacOS/Flash Player"

if test $# = 0
	then
		"$APP"&
		exit
fi

for f in "$@"
do
	open -a "$APP" -n "$f"&
done

To get it assigned as a default file-type I added the script into an Automator .app, and then edited the info.plist file, copying across the CFBundleDocumentTypes from the Flash Player.app so that it will map onto the same file-types, allowing you to select the Automator .app I created as an intermediary.

I've attached the little .app I created, it currently points to the CS5 Flash Player, but if you edit the script (open the .wflow file inside the .app, don't use Automator or you'll overwrite all the extra stuff) you can point it to whichever Flash Player you need.

Anyway, thanks very much for the hint LPZ!
 

Attachments

  • Flash Launcher.zip
    885.2 KB · Views: 62
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.