AI2: copy screens using Windows Explorer

19,930 views
Skip to first unread message

Scott Ferguson

unread,
Dec 9, 2013, 1:11:55 PM12/9/13
to

This technique of copying screens in an AI2 project uses Windows Explorer to add new screens to an AI2 project. 

When copying screens manually, be careful not to use keywords such as 'Button' for your new screen names as 'button' is one of the words used in component definitions in the screen files. Manually copying a screen named 'Button' will cause any button definitions to be corrupted by replacing 'button' with the new screen name and the new screen will not work. I add an SCR suffix to my screen names to insure that this does not happen. Alternatively you could make sure that you avoid those keywords.

Also, when copying screens from one project to another, be sure to also copy any assets needed by those screens from the source project to the destination project.

Screen CanvasSCR will be copied and named ClockSCR. I captured the screens for each step of the process below: 

Export your project to a folder on your computer.
Then place a copy of it with the original name in another folder for adding the new screen to.

Replace the aia extension on the copy's project name with a zip extension:

Open the project with Windows Explorer:

Navigate to the folder containing the screen files:

Drag the files with the screen name to be copied out of the archive:

-

Edit each file:

Replace all instances of the old screen name with the new screen name:

...then save each file.

Rename the Screen files to the new screen name:

Drag a copy of the the renamed screens to the archive:

Change the project extension back to aia:

When you import the project into AI2 it will contain the new screen. If you have an <old screen name>.Initialize block in the original screen it will now be named <new screen name>.Initialize in the copied screen.

END


vasista k.j

unread,
Mar 13, 2014, 12:17:51 AM3/13/14
to app-inventor-de...@googlegroups.com
Hi,

I tried similar steps as explained below for creating duplicate screen. But while upload I am getting below error 

"The selected project is not a project source file! Project source files are aia files. "

But I renamed the zip file back to .aia 

Could you please help on this

thanks
Vasistha

Scott Ferguson

unread,
Mar 13, 2014, 8:32:17 AM3/13/14
to app-inventor-de...@googlegroups.com
Email me a good copy of the project with instructions on what you want done and I will do it for you.

Scott Ferguson

unread,
Mar 13, 2014, 8:36:58 AM3/13/14
to app-inventor-de...@googlegroups.com

Noah Lin

unread,
Mar 14, 2014, 11:47:48 PM3/14/14
to app-inventor-de...@googlegroups.com
When I Rename the files back to .aia it stays as a .zip file causing it to not be able to be imported into App Inventor. How do you change the file back to a .aia file?

vasista k.j

unread,
Mar 15, 2014, 2:18:12 AM3/15/14
to app-inventor-de...@googlegroups.com
@Noah,

Make sure you followed the steps exactly as said.
Important : 
1. create two copies of the aia project. Say xyz.aia and xyz_copy.aia.
2. rename both files to .zip.   ==> xyz.zip and xyz_copy.zip
3. unzip xyz_copy.zip file. create copy of the screen as explained above.
4. move the newly created ( copied and then renamed ) screens from xyz_copy folder to xyz.zip
  move here is drag from copy folder to zip file using windows explorer 
5. rename xyz.zip to xyz.aia

upload this file

Scott Ferguson

unread,
Mar 15, 2014, 12:11:51 PM3/15/14
to app-inventor-de...@googlegroups.com
Thanks for that explanation, vasista :)
Also, I have a method that uses a third-party utility called 7zip.
It makes the process a bit easier - you don't have to rename your aia to zip then back to aia with that.
It works directly with the aia archive and recognizes it as such.
That is the method that I use.
I made the Windows Explorer method so users would not have to install 3rd-party sofware, but 7zip is safe to use.
---
Scott

ju...@technovationchallenge.org

unread,
Apr 15, 2014, 8:47:31 PM4/15/14
to app-inventor-de...@googlegroups.com
Is there a way to do this from a mac?

Scott Ferguson

unread,
Apr 16, 2014, 9:16:31 AM4/16/14
to app-inventor-de...@googlegroups.com
Good question!
I will post this question in the MIT forum as I would like to know the answer also: https://groups.google.com/forum/#!forum/mitappinventortest
---
Scott

Chris Jacobs

unread,
Jun 12, 2014, 6:32:08 PM6/12/14
to
Is there any way to do this with the new version of App Inventor (nls-251-gc1bdb77) and the new .apk files?
When I open up the file "appname.zip", I only get a meta-inf, res, manifest, and classes.dex, all of which either lead to unhelpful things or I can't open.

Taifun

unread,
Jun 12, 2014, 7:19:18 PM6/12/14
to app-inventor-de...@googlegroups.com
you only can copy screens for project files (zip for App Inventor Classic or aia for App Inventor 2), not apk files!
Taifun

Chris Jacobs

unread,
Jun 12, 2014, 7:27:14 PM6/12/14
to app-inventor-de...@googlegroups.com
Thanks seems so obvious now *facepalm*


On Thu, Jun 12, 2014 at 7:19 PM, Taifun <taifu...@gmail.com> wrote:
you only can copy screens for project files (zip for App Inventor Classic or aia for App Inventor 2), not apk files!
Taifun

--
(you have received this message from the App Inventor Developers Library)
---
You received this message because you are subscribed to the Google Groups "App Inventor Developers Library" group.
To unsubscribe from this group and stop receiving emails from it, send an email to app-inventor-develope...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Midget Legs

unread,
Jun 13, 2014, 1:55:56 PM6/13/14
to app-inventor-de...@googlegroups.com
Hi, I just tried this method in AI2, but it doesn't seem to work right. The new page is there, but if I attempt to click on any of the components, I get an internal message error. I was wondering if you knew what I might be doing wrong.

Scott Ferguson

unread,
Jun 16, 2014, 8:19:52 PM6/16/14
to app-inventor-de...@googlegroups.com
This method works with aia project files only.
---
Scott


On Thursday, June 12, 2014 5:32:08 PM UTC-5, Chris Jacobs wrote:
Is there any way to do this with the new version of App Inventor (nls-251-gc1bdb77) and the new .apk files?
When I open up the file "appname.zip", I only get a meta-inf, res, manifest, and classes.dex, all of which either lead to unhelpful things or I can't open.

scot...@gmail.com

unread,
Jul 2, 2014, 11:05:46 AM7/2/14
to app-inventor-de...@googlegroups.com
I followed the steps for your method, but in the end I couldn't convert the zip file back into a usable aia. Whenever I try to change the extension it changes the name to having .aia at the end, but it is still a .zip folder that I cannot upload. Any ideas?

Scott Ferguson

unread,
Jul 2, 2014, 11:00:19 PM7/2/14
to app-inventor-de...@googlegroups.com
Work directly with the archive -- in other words you open it but -- do not do an extract. That messes things up.
I am hoping that is the problem, if not, I don't know what else to suggest.
---
Scott

M. Hossein Amerkashi

unread,
Jul 2, 2014, 11:17:34 PM7/2/14
to app-inventor-de...@googlegroups.com


Scott Ferguson

unread,
Jul 3, 2014, 12:30:17 AM7/3/14
to app-inventor-de...@googlegroups.com
Nice tutorial. I need to start referring users there :)
---
Scott
To unsubscribe from this group and stop receiving emails from it, send an email to app-inventor-developers-library+unsubscribe@googlegroups.com.

M. Hossein Amerkashi

unread,
Jul 3, 2014, 6:42:06 AM7/3/14
to app-inventor-de...@googlegroups.com

Thanks Scott

To unsubscribe from this group and stop receiving emails from it, send an email to app-inventor-develope...@googlegroups.com.

Adam Scott

unread,
Jul 3, 2014, 10:05:14 AM7/3/14
to app-inventor-de...@googlegroups.com
That didn't seem to change anything. Also, I can drag the new files in to the zip folder, but from there I can't get them to the right place in the SRC folder.


On Wed, Jul 2, 2014 at 11:00 PM, Scott Ferguson <scottfr...@gmail.com> wrote:

--
(you have received this message from the App Inventor Developers Library)
---
You received this message because you are subscribed to a topic in the Google Groups "App Inventor Developers Library" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/app-inventor-developers-library/kHEFtUiJsQM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to app-inventor-develope...@googlegroups.com.

Taifun

unread,
Jul 3, 2014, 10:31:32 AM7/3/14
to app-inventor-de...@googlegroups.com
That didn't seem to change anything. Also, I can drag the new files in to the zip folder, but from there I can't get them to the right place in the SRC folder. 

why don't you navigate to the correct folder first before dragging the new file?
Taifun 

example screenshot of project basket.aia


Adam Scott

unread,
Jul 3, 2014, 10:37:32 AM7/3/14
to app-inventor-de...@googlegroups.com
That helped, but I still can't convert the zip back into an aia by renaming it, even if I don't extract the files from it


Taifun

unread,
Jul 3, 2014, 11:12:11 AM7/3/14
to app-inventor-de...@googlegroups.com
are you saying, you are not able to rename a file?
btw. in the example above I opened the aia file using 7zip without renaming into zip!
Taifun

Adam Scott

unread,
Jul 3, 2014, 11:27:27 AM7/3/14
to app-inventor-de...@googlegroups.com
I can rename 'file'.aia into 'file'.zip as a zip folder, but when i try to rename that back into 'file'.aia I get 'file.zip'.zip as a zip folder.
Trying out the 7zip method gets more tempting as this continues to not work


On Thu, Jul 3, 2014 at 11:12 AM, Taifun <taifu...@gmail.com> wrote:

--

Taifun

unread,
Jul 3, 2014, 11:57:28 AM7/3/14
to app-inventor-de...@googlegroups.com

Adam Scott

unread,
Jul 3, 2014, 12:45:04 PM7/3/14
to app-inventor-de...@googlegroups.com
That solved my problem, everything works now. Thank you very much for the help


--

Scott Ferguson

unread,
Jul 3, 2014, 5:32:30 PM7/3/14
to app-inventor-de...@googlegroups.com
Nice catch, Taifun :)
---
Scott

Tim Carter

unread,
Aug 30, 2014, 6:40:04 AM8/30/14
to app-inventor-de...@googlegroups.com
Can confirm this works using linux with built in archive utilities, Leafpad and Thunar


What other edits are necessary to copy only blocks/components into an existing screen. I have many situations where I have a discreet set of code, blocks and components to perform a function in a project. So this all lives in Screen 1 of the source project and I want it in Screen 1 of the target project. Generally the source code will not impact on the target pre-existing code?  ( I tend to use the old school method for multiple views, as opposed to multiple screens ;) )

Tim

Adam Scott

unread,
Aug 30, 2014, 10:13:28 AM8/30/14
to app-inventor-de...@googlegroups.com
I would recommend making multiple copies of the project that has Screen1 with the source code. Leave one untouched and build the apps that need the code from the copies. If you have already written code for the app and need to add the source code, that would be more complicated to do automatically, and you may have to add it manually.


--

Scott Ferguson

unread,
Aug 30, 2014, 10:27:37 PM8/30/14
to
@Tim-
Thanks for letting us know--
I don't have Linux or Mac so could not test on those.

As a follow up to your question, you can ony copy a whole screen.
That is not to say someone cannot figure out a way to add xml text representing blocks in the .bky files but they seem to contain serialized id tags that I would not know how to generate.
---
sf

Rob Higbie

unread,
Nov 8, 2014, 6:09:13 PM11/8/14
to app-inventor-de...@googlegroups.com

You probably have file name extensions hidden.  Since "aia" is not a recognized extension, it shows up.  When you change it to "zip", it disappears.  Then when you change it back to "aia", it reappears, but "zip" is still there, hidden.  So the file extension is really "zip" even though what you see is "aia".  Get it?

  


On Wednesday, July 2, 2014 10:05:46 AM UTC-5, scot...@gmail.com wrote:

David Diamond

unread,
Dec 16, 2014, 8:10:26 PM12/16/14
to
I tried this technique with an AI2 project.  It worked fine, except that, in the AI2 Designer, in the copied screen, the image (a .png asset) does not display on the canvas in the new, copied screen.  It displays fine in AI Companion on the device.  It also displays fine on the original screen (Screen1) in the AI2 Designer.  Both screens list the image file in the Designer and in the canvas backgroundimage property.

Using the technique in this thread, I took the tutorial project "PaintPot", and copied "Screen1" to a new screen "Meow_scr".  I discovered this problem when I imported the new project into the AI2 online development environment.

To test it on the device, I added a "Go to Meow_scr" button to Screen1.   It works perfectly on the device.  The cat image displays on both screens, "Screen1" and "Meow_scr" (which is an identical copy of Screen1 with all occurrences of "Screen1" having been changed to "Meow_scr" and filenames changed to the new screen name).

I also tried using a different image file in the canvas on Meow_scr.  That did not help the situation.

The bottom line is that this technique appears to work fine in AI2, but there is a quirk in how it displays in the Designer.

Any suggestions or explanations?

David D.

Scott Ferguson

unread,
Feb 5, 2015, 4:52:01 AM2/5/15
to app-inventor-de...@googlegroups.com
My only thought is to be sure to copy your assets if copying from one project to another.
Assets already contained in a project where the screens are being copied/added should be available automatically to the copied/new screens.
---
sf

Mahesh Viswanathan

unread,
Feb 1, 2016, 11:29:21 PM2/1/16
to App Inventor Developers Library

don't forget to change the name of the screen in Screen1.scm. e.g.


#|
$JSON
{"YaVersion":"140","Source":"Form","Properties":{"$Name":"Screen1","$Type":"Form","$Version":"18","AppName":"FileByFile_copy","Icon":"icon.png","Title":"Webprefetch File by File","Uuid":"0","$Components":[{"$Name":"Label1","$Type":"Label","$Version":"3","HasMargins":"False","Height":"-2","Uuid":"1990261919"},{"$Name":"varDownload","$Type":"VerticalArrangement",
etc., etc.

Scott Ferguson

unread,
Feb 2, 2016, 12:40:27 PM2/2/16
to app-inventor-de...@googlegroups.com
That is correct if you are replacing Screen1.scm's text with <another name>.scm's text since the first screen must always be named 'Screen1'.
---
sf

Tim Houser

unread,
Apr 3, 2016, 2:01:49 AM4/3/16
to App Inventor Developers Library

I created an application that will Copy and also Rename screens very easily.  See screens below and Link beyond that.



 

Scott Ferguson

unread,
Apr 3, 2016, 7:31:10 AM4/3/16
to app-inventor-de...@googlegroups.com
Looks great, Tim :-)
When I run the executable on Windows 10, I get a blank dialog and it goes no further:

It passed my Avast antivirus scan and Windows allowed me to run it, but not without warning.

So users may have to tell it to 'run anyway'.

---

Abraham Getzler

unread,
Apr 3, 2016, 12:23:25 PM4/3/16
to app-inventor-de...@googlegroups.com
I looked in the github link, and did not see any source code.
Am I missing something here?
ABG

ABG
(Personal emails from boards are auto-spam deleted)


On Sun, Apr 3, 2016 at 7:31 AM, Scott Ferguson <sfsvid...@gmail.com> wrote:
Looks great, tim :-)
When I run the executable on Windows 10, I get a blank dialog and it goes no further:

It passed my Avast antivirus scan and Windows allowed me to run it, but not without warning.

So users will have to tell it to 'run anyway'.

---



On Sunday, April 3, 2016 at 1:01:49 AM UTC-5, Tim Houser wrote:

I created an application that will Copy and also Rename screens very easily.  See screens below and Link beyond that.



 

--
(you have received this message from the App Inventor Developers Library)
---
You received this message because you are subscribed to the Google Groups "App Inventor Developers Library" group.
To unsubscribe from this group and stop receiving emails from it, send an email to app-inventor-develope...@googlegroups.com.

Scott Ferguson

unread,
Apr 3, 2016, 2:46:25 PM4/3/16
to App Inventor Developers Library
It was done with Auto-It 3, Abraham.
He just included the executable, I think.
But he is working on a bug fix which includes the missing image files this afternoon.
---
To unsubscribe from this group and stop receiving emails from it, send an email to app-inventor-developers-library+unsubscribe@googlegroups.com.

Steve V

unread,
Apr 13, 2017, 7:26:41 AM4/13/17
to App Inventor Developers Library
I searched the web without success. Can anyone tell me, what is the secret to printing this discussion without being limited to the first page only? Affects both Chrome and IE, my windows 7 workstation being completely up to date.
 

Horst Schulze

unread,
Mar 11, 2019, 5:55:39 AM3/11/19
to App Inventor Developers Library
Sorry to all,

I think this all is outdated, It does not work. Maybe something changed.

Even the tool on github does not work, at least I did not found a way to get a reaction from the exe file.

Taifun

unread,
Mar 11, 2019, 9:37:50 AM3/11/19
to App Inventor Developers Library
the manual method of copying and renaming works 
you only have to be careful and follow the steps. 

see also your successful attempt how to do it here https://groups.google.com/d/msg/mitappinventortest/fWmpNpcNuaw/foY_o4zTBwAJ
glad you got i working in the end...

Taifun
Reply all
Reply to author
Forward
0 new messages