Script works in Script Editor, when saved as app, no longer works

I've been playing around with AppleScript trying to learn a little. I wrote an app to fullscreen the current application. First I wrote one to full screen a specific app:
tell application "Safari"
set the bounds of the first window to {0, 0, 1440, 894}
activate
end tell
This worked without any problems and I set a keyboard shortcut to activate it.
Then I decided to make it work for the current app:
tell current application
set the bounds of the first window to {0, 0, 1440, 894}
end tell
When I ran it in Script Editor, it worked fine and set the bounds of the Script Editor window to what I asked. When I save it as an application the same way I did the first app, it doesn't work. I get the error message "Can't set the bounds of window 1 to {0, 0, 1440, 894}." I tried it on the same Script Editor window it worked on when I simply clicked run, but I keep getting the error message.

try something like this saved as an app
tell application "AppleScript Editor"
activate
make new document
set the bounds of the first window to {0, 0, 1440, 894}
make new paragraph at beginning of document 1 with data "hello world"
end tell
tell application "TextEdit"
activate
make new document
set the bounds of the first window to {0, 0, 1440, 894}
make new paragraph at beginning of document 1 with data "hello world"
end tell
Budgie

Similar Messages

  • Unresponsive Script Error when Saving Changed Set in Flickr Organizer

    I'm getting an unresponsive script error when saving a changed set in the Flickr organizer.
    The problem started when using Firefox 3.6.8 or maybe an earlier version. It persists in Firefox 3.6.12
    I've noticed the error only appears in the Organizer and only when saving a changed set or saving after deleting a set.
    It does indeed save the changed set correctly before crashing.
    It is not intermittent and happens every time I perform this save.
    The error does not occur in Chrome or Safari.
    Examples of the error messages can be found at
    http://www.flickr.com/photos/blazer8696/4897580573/
    and
    http://www.flickr.com/photos/blazer8696/4897656175/

    Upgrading to 4.0.1 has corrected this problem.

  • Script Editor does not work. Panel blue and empty.

    Hi
    I installed Oracle Database XE yesterday on
    Acer TravelMate C300, Microsoft XP SP2 Tablet Edition
    and ..
    I cannot read SQL scripts
    I cannot access to the editing panel of Scripts Editor when I want to create a new script.
    I used System and HR login.
    The panel is blue and empty.
    Thank you for any information
    Best regards
    JRD120

    I cannot read SQL scriptsWhere you want to read SQL scripts?
    I cannot access to the editing panel of Scripts
    Editor when I want to create a new script.About which "Scripts Editor" you talking about? From TOAD?
    The panel is blue and empty.Panel??

  • Problem in long text in SAP script editor

    Hi ,
    i am maintaining long text in SAP script editor , when i am trying to change the long text in SAP script that changes are not reflected in print preview ,for example when i am giving tabs in the script then in print preview of the PO these tabs are displayed as , , ( comma) , and underlines are not appearing in print preview.please help me on this.
    Thanks and regards.
    Rajeshwar.

    hi
    you have to install the correct printer which supports the displaying the drawings and objects/

  • Illustrator CC hangs when saving files

    illustrator always hangs when saving and take a long time for open the up to 100 MB files.
    Hi,
    My illustrator CC always hangs when save the file and
    very long process to open just 100 MB files.
    I just changed the Windows from 7 to 8.1 pro and this issue is happening with me.
    I tried to reinstall again and again but the problem is not gone.
    I download via creative cloud. Only happen with illustrator CC
    Anyone please helps
    please excuse my poor English.
    Thank you.

    Hi Apiraya,
    Try to reset the preferences of Illustrator  to default.
    https://helpx.adobe.com/illustrator/using/setting-preferences.html
    Hope this helps.
    Regards,
    Sumit Singh

  • Scripting Applescript Editor and saving files

    I've created an Applescript that generates a smaller, simpler script.  I've gotten everything to work, but when I tell Applescript Editor to save the file, it doesn't work.  It doesn't error out, it acts like it finished properly, but nothing shows up in the location I told it to save.  Here's the snippet that's giving me problems:
    tell application "AppleScript Editor"
    activate
    make new document
    set contents of document 1 to fnlScrpt
    compile document 1
    save document 1 in "Macintosh HD:" as "application"
    close document 1 without saving
    end tell
    I'm going to define a more specific save location once I get it working, but for now it just saves to the top level.  It needs to save as an application, and close the script without saving it.  Any help is appreciated!

    Hi all,  I'm a little late to this thread in an attempt to get some scripts working in Lion.    Thanks for the help.  I noticed the way you set your globals, and the way you're having variables get passed on to recompiled scripts.  
    I take a different approach,  by writing my Applescript as text,  in quotation marks,  and then relying on fields getting filled in when the Applescript Editor is run, and the new script has the correct data.      I make one text entry called "QT_multiliner" and fill in variables using quotation marks and ampersands. 
    THIS FIRST SCRIPT is used to take variables given to it by a database,  and generate a custom applescript for any given record in the database.  
    set yyyymmdd to (((year of (current date)) * 10000) + ((month of (current date)) * 100) + (day of (current date))) as text
    set mmdd to (text items 5 through 8 of (yyyymmdd)) as text
    set qtPath to "/path/to/folder/" & mmdd & "/"
    set RenderPrefix to "filename_of_choice"
    set TGA_path to "/path/to/folder_with_files/" & mmdd & "/" & RenderPrefix & "/" as text
    set appletPath to "/path/to/folder/applet_name_" & RenderPrefix & ".app"
    set temp_doc to POSIX file appletPath
    --write the applet in Script Editor.  Variables will be filled in and compiled in Script Editor.
    set QT_multiliner to "tell application \"Finder\"
    set thePath to \"" & TGA_path & "\" as string
    activate
    make new Finder window
    set target of Finder window 1 to (POSIX file thePath)
    set theSequence to get first file of the front window as alias
    close window 1
    end tell
    set sequenceName to \"" & RenderPrefix & ".mov\"
    tell application id \"com.apple.quicktimeplayer\"
              activate
              open image sequence  theSequence  frames per second 23.98
              set savePath to \"" & qtPath & "/\" & sequenceName
              tell movie 1
                             with timeout of 2400 seconds
                                            export to  (POSIX file savePath) as QuickTime movie using settings alias \"path:to:settings:file\"
                             end timeout
                             close saving no
              end tell
              quit
    end tell"
    -- Write the script to its own applet 
    tell application id "com.apple.ScriptEditor2"
              set x to make new document
              set x to the front document
              set the text of document 1 to QT_multiliner
      compile document 1
              save document 1 as "application" in (temp_doc)
      quit
    end tell
    ...now,  when that is run,  the following applescript is generated with all of the variables filled in. 
    --This applet was saved by the previous script, and is saved as /path/to/folder/applet_name_filename_of_choice.app
    tell application "Finder"
              set thePath to "/path/to/folder_with_files/0112/filename_of_choice/" as string
      activate
      make new Finder window
              set target of Finder window 1 to (POSIX file thePath)
              set theSequence to get first file of the front window as alias
      close window 1
    end tell
    set sequenceName to "filename_of_choice.mov"
    tell application id "com.apple.quicktimeplayer"
      activate
      open image sequence theSequence frames per second 23.98
              set savePath to "/path/to/folder/0112//" & sequenceName
              tell document 1
                             with timeout of 2400 seconds
                                            export to (POSIX file savePath) as QuickTime movie using settings alias "path:to:settings:file"
                             end timeout
          close saving no
              end tell
      quit
    end tell
    I really liked Camelot's "script / end script" function,  it's better,  but I just couldn't get it to pipe variables through from one script to another.     Since I need to run this script on any one of dozens of computers,  I need the variables to be compiled and saved within each applet. 
    all the best,
    Vic

  • 10g Express Edition; Problem saving updates in Script Editor

    I'm running 10g Express Edition on Windows XP Media Center with SP3 with Internet Explorer 7.
    I start with 'Go to Database Home Page'.
    Then take the path Home>SQL>SQL Scripts>Script Editor;
    I've created a Script called HW.
    I make some changes to the script
    Then I click the 'Save' button.
    Then I click the icon for my HW script.
    But when I look at my script my updates are not there.
    This does not happen all the time.
    Sometimes the save seems to work, and sometimes it doesn't.
    I've noticed the same thing with Run. Sometimes my changes
    will appear in the script that got Run. Sometimes they won't.
    Any ideas on what I need to be doing to consistently Save my
    updates in Script Editor? fwiw, I like Script Editor for what I need
    to do - create scripts, export them as .sql files, etc. But I'm not
    opposed to using another tool to do this.
    Thanks.

    SQL> select owner,object_type,status from all_objects where lower(object_name) = 'dbms_xdb';
    select owner,object_type,status from all_objects where lower(object_name) = 'dbms_xdb'
    ERROR at line 1:
    ORA-01219: database not open: queries allowed on fixed tables/views only
    So, I have tried the following:
    ->
    SQL> alter database open;
    alter database open
    ERROR at line 1:
    ORA-01507: database not mounted
    SQL> alter database mount;
    alter database mount
    ERROR at line 1:
    ORA-00205: error in identifying control file, check alert log for more info
    SQL> alter database create standby controlfile as 'ora_control1' reuse;
    alter database create standby controlfile as 'ora_control1' reuse
    ERROR at line 1:
    ORA-01507: database not mounted
    I'm quite confused right now.

  • Script to require user to update comments in info window when saving file?

    I work in a print production department where many different people are modifying files (InDesign, photoshop, Illustrator, etc.) on a central network every day. Users copy the file they want to work on to their desktop, modify it, and then replace the original on the network with the modified version.
    It can happen, though, that either someone doesn't save their work back to the network--or the opposite, where someone inadvertently overwrites a file on the network with a version that isn't as recent. Unfortunately, the information window (the one that you can access by right-clicking a file or, in the Finder column view, clicking on the "Get Info" button) doesn't identify the most recent user of a file--just the date created, modified, last opened, etc. When files on the server are incorrect for whatever reason, it can be difficult to figure out what happened. This info can be entered manually in the "Comments" field, but users either forget or are too busy to add that step into their routine.
    Can a script to written that will prompt/require them to add at least their initials, date last changed, and for what reason, in the comments field before saving? It would be ideal if the script could somehow prompt users to do this only when saving files to the network--or, failing that, at least only prompt them once if they're just saving a file they've already dragged to their desktop back to the desktop for backup reasons.
    Is this possible? Truly, I know almost nothing about AppleScript, but someone here was really, really helpful last week with a file-comparison script that has saved lives already. I'm trying to learn more, but meanwhile, I thought I'd ask.
    Thank you so much in advance!

    I can't see any way of doing this.
    It would require hooks into every application's Save dialog, which just isn't an option.
    The only possible way it might work is a folder action on the network folder that somehow adds the username to the comments field of any file as it's transferred to the server. Not quite the same thing, and I've no idea how folder actions work in a multi-user environment but it might be worth a try.
    The problem may be that every users' system will see the new file getting added, so every system tries to fire off the folder action, with unpredictable results.

  • Address Book opens when a script is opened, while script editor was closed

    Hi,
    Something puzzles me :
    I have a very simple script with only these two lines :
    tell application "Address Book"
    end tell
    This script is saved as a simple script.
    When I open the script with script editor,
    * if script editor was already open, the script opens normally and I can edit it
    * if script editor was not already open, then Address Book opens itself (and the script opens itself with script editor)
    What explains the opening of Address Book ?
    What can I do to avoid this auto-opening of Address Book ?
    Thanks for your help,
    Nicolas

    You were right, the script will not compile. (there are some instruction between the "tell" and the "end tell" lines)
    There are a couple of solutions to that one.
    The first is that the script will compile if you're only using standard commands like 'activate', 'quit', etc. inside the tell block - these commands are universal, supported by all applications, and therefore you don't need the application dictionary.
    If you are using application-specific commands, though, then you can provide the Script Editor a hint as to which dictionary to use via the using terms from command.
    This tells the compiler which application dictionary to use when compiling the script, but it shouldn't affect opening the script. If you're only targeting one application and don't mind this workaround, it could be your solution:
    -- here's our target application
    set appName to "Address Book"
     -- let's target it
    tell application appName
      -- now provide the compiler a hint as to which application dictionary to use
      using terms from application "Address Book"
        -- commands go here
      end using terms from
    end tell
    When it comes to compile the script, AppleScript will use the application in the using terms from statement instead of the (unknown) application in the tell statement.

  • Links to launch Script Editor no longer work

    Links to launch Script Editor no longer work.

    I don't know, I just use a very simple Applescript to enclose the clipboard in tags that allow the user to launch Script Editor from the browser:
    set the clipboard to "<a href=applescript://com.apple.scripteditor?action=new>Click here to launch Script Editor</a>.
    <pre class=COMMAND>" & return & (the clipboard) & return & "</pre>"
    And it wraps the script on the clipboard on PRE tags so the structure is preserved. Neither of those work now.

  • Error when using function CDbl in Script Editor

    Hello,
    While using the CDbl function in the Script Editor I am getting the following error:
    Error - 13 - Type mismatch: 'CDbl' at Line 24
    The reason I am trying to use CDbl is that I get another error while importing the data from a .CSV file
    Import Error = TC - [Amount=NN|http://forums.oracle.com/forums/] 01-000-1030,Cash in Bank - Payroll,837.83,0.00,"1,569.50",0.00
    Any suggestions would be appreciated.
    -Tony

    Tony,
    Please keep in mind that pressing 'Save' and then 'Run' without using the script in a workflow is sometimes not a valid test. As the scripting generally created inside of FDM needs to be part of a workflow and certain variables/functions are passed when that workflow is executed as a whole.
    Hopefully this helps...

  • CCX 10.5 Script Editor Not Working Win7 Enterrpise 64 Bit

    Anybody else running into this?  Other colleagues stated that they have CCX 10.X editors working with Windows 7 32 bit.
    My issue is that the initial splash screen comes up for a quick sec and goes away.  I've tried Win XP compatibility and Run As Administrator.
    Found this post where I think the original person was referring to CCX 7.0 and people replying where referring to the issue that I'm running into with CCX 10.5
    https://supportforums.cisco.com/discussion/12149992/ccx-script-editor-hangs-win7-then-closes
    Thanks,
    Dan

    Hi Dan,
    We have seen such issues with UCCX 10.5 editor. For some reason on the other issue, the editor was not installed in the correct location (default).
    Solution:
    * Uninstall the editor.
    * Install the editor (Run as administrator) directly into Program files in the
    path : C:\Program Files (x86)\wfavvid_1051
    * Run the application by running it as Administrator.
    * While uninstalling and reinstalling, try to keep the anti-virus disabled.
    Let me know how it goes.
    Regards,
    Arundeep

  • Script Editor Not Working

    I have a problem with the script editor that is login (Windows login, not Oracle login) dependent. For some Windows users, the script editor doesn't work properly. For those users, the editor page will appear but the edit pane cannot be written. In addition the line number for the first line is not present. The buttons for upload and other functions do not function. If any scripts are already present, the icons appear, but clicking on them does not bring them up in the edit pane.
    For other Windows users, everything works normally.
    For all Windows users, the initial login to the database appears to work fine.
    It is clear that the problem is related to some property of the Windows login for the various users, but I don't know where to start looking. Does anyone have a suggestion?
    Thanks in advance.

    I am having this same problem in Linux. I am using Ubuntu 8.04 and I am following the tutorial at:http://st-curriculum.oracle.com/tutorial/DBXETutorial/index.htm
    I seem to be able to load a sample data file, but trying to access the file in the script editor, I cant see the file. I even tried to manually make a load_sample.sql file, but the script editor doesnt let me. Any help to get this working would be appreciated.
    thanks,
    blu.....

  • Always Script Editor ... Alt Gr key does not work

    Hi,
    With IE6 in SQL Script Editor
    Alt Gr Key does not work.
    For instance, I cannot type ||
    In fact it's a copy-paste from SQL command (which works well)
    Note Script Editor does not work with Firefox.
    Thank you for any information
    Regards
    JRD120

    You might try this:
    Remove any USB device except mouse/keyboard
    Perform a PRAM-reset (hold ALT-CMD-P-R until you've heard the starting chime 3 times)

  • AW memory error when clicking "Edit Script" on ICM 7.2.7 Script editor

    I have installed a new AW/HDS(ICM 7.2.7).Installation went on smoothly but when i open a exist script through script editor and click "Edit Script", I get memory error "The instruction at "0x7c1..the memory could not be read" and the script editor closes automatically. I am able to make changes in Configuration Manager without any issues.The new server is configured as a secondary pointing to a primary distributor in a different region.Let me know if anyone has faced this issue or have any idea.All the ICM processes on the server looks fine. I am able to open the same script from other AWs without any issues.
    Thanks
    KMS

    I would run "Initialize Local Database" on the secondary to drop the local AW DB and rebuild it from the Central Controller.
    Then I would try stopping the primary Distributor so the Secondary establishes the real-time feed to the Router by itself and check.
    Regards,
    Geoff

Maybe you are looking for

  • How to refer the class package "com.sapportals.connector" for MDM API?

    Hi, Iam trying to execute one example mdm api program in dynpro/ejb. I could not refer the class package com.sapportals.connector. What SCA or build path package needed for dev time and runtime and where do i get that. Please help me. Thanks Hari

  • Outer join in hibernate

    Hi, Beforehand I know this is not the proper forum to post questions about hibernate, but I'm desperetly looking answers for this problem, so any help is welcome: My original Oracle SQL query looks like: select R.orden as Orden, Max(R.fichero) as Fic

  • ALE - error in custom  message type creation

    HAI friends, I am new to ALE IDOC, i am creating custom message type for custom table . i created segment, idoc, message type and executed  outbound program . in outbound client, status is dispatch ok. so problem in outbound. my problem is in inbound

  • Question on Loop

    Why is it when I try to print num, it cannot find symbol, but when I use while loop it can? public class ForLoop {      public static void main (String[] args) {           int sum=0;           for (int num=0; num<10; num++) {                sum+=num;

  • Just installed Panther, Safari crashs constantly... ideas? (inc. crash log)

    Hey guys, so while my regular computer is being worked on, I'm using this old PowerMac G4 (400 Ghz, I know, it's old). I actually just had to Archive & (Re)install Panther--a friend from the Geek Squad had worked on/looked at it recently regarding re